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

Commit

Permalink
Don't make .babelrc a requirement. (#103)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
zigomir authored and yyx990803 committed Jun 30, 2016
1 parent dc6de0b commit cda407d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/compilers/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ function getBabelRc () {
return rc
}

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

module.exports = function (raw, cb, compiler, filePath) {
try {
var babel = require('babel-core')
var options = assign({
Expand Down

0 comments on commit cda407d

Please sign in to comment.