Skip to content
This repository was archived by the owner on Jul 27, 2021. It is now read-only.

Commit aa98706

Browse files
feat: update babel 7 (#95)
* chore: update jest * feat: update babel 7
1 parent 4d66ccc commit aa98706

File tree

15 files changed

+1434
-901
lines changed

15 files changed

+1434
-901
lines changed

.babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
"only": ["test/"],
3+
"plugins": ["@babel/plugin-transform-async-to-generator"]
4+
}

.babelrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

_sandbox/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
},
2020
{
2121
test: /\.jsx?$/,
22-
loader: 'babel-loader',
22+
loader: require.resolve('babel-loader-7'),
2323
query: {
2424
presets: ['react'],
2525
},

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

22
const FriendlyErrorsWebpackPlugin = require('./src/friendly-errors-plugin');
33

4-
module.exports = FriendlyErrorsWebpackPlugin;
4+
module.exports = FriendlyErrorsWebpackPlugin;
5+
module.exports.default = FriendlyErrorsWebpackPlugin;

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,27 @@
2828
"url": "https://github.com/geowarin/friendly-errors-webpack-plugin/issues"
2929
},
3030
"license": "MIT",
31+
"jest": {
32+
"testEnvironment": "node",
33+
"transformIgnorePatterns": ["node_modules", "src", "index.js"]
34+
},
3135
"peerDependencies": {
3236
"webpack": "^4.0.0"
3337
},
3438
"devDependencies": {
39+
"@babel/core": "^7.5.4",
40+
"@babel/plugin-transform-async-to-generator": "^7.5.0",
3541
"autoprefixer": "^9.6.0",
36-
"babel-core": "^6.23.1",
42+
"babel-core": "6.26.3",
3743
"babel-eslint": "^10.0.1",
38-
"babel-loader": "^7.1.4",
39-
"babel-plugin-transform-async-to-generator": "^6.24.1",
40-
"babel-preset-react": "^6.23.0",
44+
"babel-loader-8@npm:babel-loader": "^8.0.6",
45+
"babel-loader-7@npm:babel-loader": "^7.1.4",
4146
"css-loader": "^2.1.1",
4247
"eslint": "^5.16.0",
4348
"eslint-loader": "^2.1.2",
4449
"eslint-plugin-node": "^9.0.1",
4550
"expect": "^24.8.0",
46-
"jest": "^18.1.0",
51+
"jest": "^24.8.0",
4752
"memory-fs": "^0.4.1",
4853
"mini-css-extract-plugin": "^0.6.0",
4954
"node-sass": "^4.12.0",

src/transformers/babelSyntax.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ function cleanMessage(message) {
1818
.replace(/^Module build failed.*:\s/, 'Syntax Error: ')
1919
// remove mini-css-extract-plugin loader tracing errors
2020
.replace(/^Syntax Error: ModuleBuildError:.*:\s/, '')
21-
// remove babel extra wording
22-
.replace('SyntaxError: ', '');
21+
// remove babel extra wording and path
22+
.replace(/^Syntax Error: SyntaxError: (([A-Z]:)?\/.*:\s)?/, 'Syntax Error: ');
2323
}
2424

2525
function isBabelSyntaxError(e) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
File renamed without changes.

test/fixtures/babel-syntax/webpack.config.js renamed to test/fixtures/babel-syntax-babel-6/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module.exports = {
1515
{
1616
test: /\.jsx?$/,
1717
exclude: /node_modules/,
18-
loader: 'babel-loader',
18+
loader: require.resolve('babel-loader-7'),
1919
}
2020
]
2121
},
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)