Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit cda407d

Browse files
zigomiryyx990803
authored andcommitted
Don't make .babelrc a requirement. (#103)
* Don't make .babelrc a requirement. If you don't have a .babelrc file in your project you still get babel warning: "You are trying to use "babel". babel-preset-es2015, babel-runtime and babel-plugin-transform-runtime are missing." * Move only comparison to exported function.
1 parent dc6de0b commit cda407d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/compilers/babel.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ function getBabelRc () {
2323
return rc
2424
}
2525

26-
if (babelOptions === defaultBabelOptions) {
27-
try {
28-
ensureRequire('babel', ['babel-preset-es2015', 'babel-runtime', 'babel-plugin-transform-runtime'])
29-
} catch (e) {
30-
console.error(e.message)
31-
console.error(
32-
'\n^^^ You are seeing this because you are using Vueify\'s default babel ' +
33-
'configuration. You can override this with .babelrc or the babel option ' +
34-
'in vue.config.js.'
35-
)
26+
module.exports = function (raw, cb, compiler, filePath) {
27+
if (babelOptions === defaultBabelOptions) {
28+
try {
29+
ensureRequire('babel', ['babel-preset-es2015', 'babel-runtime', 'babel-plugin-transform-runtime'])
30+
} catch (e) {
31+
console.error(e.message)
32+
console.error(
33+
'\n^^^ You are seeing this because you are using Vueify\'s default babel ' +
34+
'configuration. You can override this with .babelrc or the babel option ' +
35+
'in vue.config.js.'
36+
)
37+
}
3638
}
37-
}
3839

39-
module.exports = function (raw, cb, compiler, filePath) {
4040
try {
4141
var babel = require('babel-core')
4242
var options = assign({

0 commit comments

Comments
 (0)