Skip to content

Commit 83341db

Browse files
authored
Merge pull request #41 from weaverryan/fix-babel-loader-7.1
Forcing babel-loader 7.1 and updating resolve-rc for new argument
2 parents db980b4 + 27c3006 commit 83341db

File tree

6 files changed

+234
-100
lines changed

6 files changed

+234
-100
lines changed

lib/WebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class WebpackConfig {
176176
}
177177

178178
if (this.doesBabelRcFileExist()) {
179-
throw new Error('configureBabel() cannot be called because your app has a .babelrc file. Either put all of your Babel configuration in that file, or delete it and use this function.');
179+
throw new Error('configureBabel() cannot be called because your app already has Babel configuration (a `.babelrc` file, `.babelrc.js` file or `babel` key in `package.json`). Either put all of your Babel configuration in that file, or delete it and use this function.');
180180
}
181181

182182
this.babelConfigurationCallback = callback;

lib/config/parse-runtime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ module.exports = function(argv, cwd) {
6363
runtimeConfig.helpRequested = true;
6464
}
6565

66-
runtimeConfig.babelRcFileExists = (typeof resolveRc(runtimeConfig.context)) !== 'undefined';
66+
runtimeConfig.babelRcFileExists = (typeof resolveRc(require('fs'), runtimeConfig.context)) !== 'undefined';
6767

6868
return runtimeConfig;
6969
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"homepage": "https://github.com/symfony/webpack-encore",
2828
"dependencies": {
2929
"babel-core": "^6.24.0",
30-
"babel-loader": "^7.0.0",
30+
"babel-loader": "^7.1.0",
3131
"babel-preset-env": "^1.2.2",
3232
"chalk": "^1.1.3",
3333
"clean-webpack-plugin": "^0.1.16",

test/WebpackConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ describe('WebpackConfig object', () => {
248248

249249
expect(() => {
250250
config.configureBabel(() => {});
251-
}).to.throw('configureBabel() cannot be called because your app has a .babelrc file');
251+
}).to.throw('configureBabel() cannot be called because your app already has Babel configuration');
252252
});
253253
});
254254

test/config/parse-runtime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function createTestDirectory() {
2323
const projectDir = testSetup.createTestAppDir();
2424
fs.writeFileSync(
2525
path.join(projectDir, 'package.json'),
26-
''
26+
'{}'
2727
);
2828

2929
return projectDir;

0 commit comments

Comments
 (0)