Skip to content

Commit

Permalink
Merge pull request #1 from clay/babel
Browse files Browse the repository at this point in the history
update babel to v7
  • Loading branch information
nelsonpecora authored Sep 12, 2018
2 parents bacd1c6 + 6467103 commit c6078de
Show file tree
Hide file tree
Showing 5 changed files with 2,275 additions and 838 deletions.
2 changes: 1 addition & 1 deletion lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var insertCSSPath = normalize.lib('insert-css')

var hasBabel = true
try {
require('babel-core')
require('@babel/core')
} catch (e) {
hasBabel = false
}
Expand Down
7 changes: 3 additions & 4 deletions lib/compilers/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ var assign = require('object-assign')
var ensureRequire = require('../ensure-require')

var defaultBabelOptions = {
presets: ['es2015'],
plugins: ['transform-runtime']
presets: ['@babel/preset-env']
}

var babelRcPath = path.resolve(process.cwd(), '.babelrc')
Expand All @@ -27,7 +26,7 @@ function getBabelRc () {
module.exports = function (raw, cb, compiler, filePath) {
if ((compiler.options.babel || babelOptions) === defaultBabelOptions) {
try {
ensureRequire('babel', ['babel-preset-es2015', 'babel-runtime', 'babel-plugin-transform-runtime'])
ensureRequire('babel', ['@babel/preset-env'])
} catch (e) {
console.error(e.message)
console.error(
Expand All @@ -39,7 +38,7 @@ module.exports = function (raw, cb, compiler, filePath) {
}

try {
var babel = require('babel-core')
var babel = require('@babel/core')
var options = assign({
comments: false,
filename: filePath,
Expand Down
2 changes: 1 addition & 1 deletion lib/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports.lib = function (file) {
if (IS_TEST) {
return path.resolve(__dirname, file)
} else {
return 'vueify/lib/' + file
return '@nymag/vueify/lib/' + file
}
}

Expand Down
Loading

0 comments on commit c6078de

Please sign in to comment.