Skip to content

Commit 79793ef

Browse files
gzzhanghaoyyx990803
authored andcommitted
Parse babelrc with json5 (vuejs#161)
* Parse babelrc with json5 * Include json5 in package.json
1 parent 1c2dce7 commit 79793ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/compilers/babel.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var fs = require('fs')
22
var path = require('path')
3+
var json = require('json5')
34
var assign = require('object-assign')
45
var ensureRequire = require('../ensure-require')
56

@@ -16,7 +17,7 @@ var babelOptions = fs.existsSync(babelRcPath)
1617
function getBabelRc () {
1718
var rc
1819
try {
19-
rc = JSON.parse(fs.readFileSync(babelRcPath, 'utf-8'))
20+
rc = json.parse(fs.readFileSync(babelRcPath, 'utf-8'))
2021
} catch (e) {
2122
throw new Error('[vueify] Your .babelrc seems to be incorrectly formatted.')
2223
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"postcss-selector-parser": "^2.0.0",
3232
"source-map": "^0.5.6",
3333
"through": "^2.3.6",
34+
"json5": "^0.5.1",
3435
"vue-hot-reload-api": "^2.0.1",
3536
"vue-template-compiler": "^2.0.0-alpha.8",
3637
"vue-template-es2015-compiler": "^1.2.2"

0 commit comments

Comments
 (0)