Skip to content

Commit 6407b5c

Browse files
committed
add note about babel 6 in readme
1 parent e1f1430 commit 6407b5c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,28 +89,28 @@ In your HTML:
8989

9090
`vue-loader` automatically applies Babel transforms to the JavaScript inside `*.vue` components. Write ES2015 today!
9191

92+
**Compatibility Note:** vue-loader 7.0+ uses Babel 6. If you need to use Babel 5 for transpiling your code, use vue-loader 6.x.
93+
9294
The default Babel options used for Vue.js components are:
9395

9496
``` js
9597
{
96-
// use babel-runtime library for common helpers
97-
optional: ['runtime'],
98-
// use loose mode for faster builds
99-
loose: 'all',
100-
// disable non-standard stuff (e.g. JSX)
101-
nonStandard: false
98+
presets: ['es2015'],
99+
plugins: ['transform-runtime']
102100
}
103101
```
104102

105-
If you wish to mofidy this, you can add a `babel` field in your webpack config, which will be merged with the default options. For example:
103+
If you wish to override this, you can add a `babel` field in your webpack config, which will be applied to all JavaScript processed by `babel-loader`. For example:
106104

107105
``` js
108106
// webpack.config.js
109107
module.exports = {
110108
// other configs...
111109
babel: {
112-
// enable stage 0 transforms
113-
stage: 0
110+
// enable stage 0 transforms.
111+
// make sure to install babel-presets-stage-0
112+
presets: ['es2015', 'stage-0'],
113+
plugins: ['transform-runtime']
114114
}
115115
}
116116
```

0 commit comments

Comments
 (0)