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

Babel 7.0 Support #239

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ Vueify is pre-configured to work with Babel. Simply install Babel-related depend

``` bash
npm install\
babel-core\
babel-preset-es2015\
@babel/core\
@babel/preset-env\
--save-dev
```

Then create a `.babelrc`:

``` json
{
"presets": ["es2015"]
"presets": ["@babel/preset-env"]
}
```

Expand Down
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
8 changes: 4 additions & 4 deletions lib/compilers/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ var assign = require('object-assign')
var ensureRequire = require('../ensure-require')

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

var babelRcPath = path.resolve(process.cwd(), '.babelrc')
Expand All @@ -27,7 +27,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', '@babel/plugin-transform-runtime'])
} catch (e) {
console.error(e.message)
console.error(
Expand All @@ -39,7 +39,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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
"convert-source-map": "^1.2.0",
"cssnano": "^3.3.2",
"hash-sum": "^1.0.2",
"json5": "^0.5.1",
"lru-cache": "^4.0.0",
"object-assign": "^4.0.1",
"postcss": "^5.0.10",
"postcss-selector-parser": "^2.0.0",
"source-map": "^0.5.6",
"through": "^2.3.6",
"json5": "^0.5.1",
"vue-hot-reload-api": "^2.0.1",
"vue-template-compiler": "^2.0.0-alpha.8",
"vue-template-es2015-compiler": "^1.2.2"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-plugin-transform-runtime": "^6.0.0",
"babel-preset-es2015": "^6.0.0",
"babel-runtime": "^6.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"browserify": "^13.0.1",
"chai": "^3.5.0",
"coffee-script": "^1.10.0",
Expand Down