Skip to content

ES2015 -> es2015 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2017
Merged
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
12 changes: 6 additions & 6 deletions lib/webpack-config/addons/add-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const makeLoaderName = name => (
)

// 修改 babel-loader 的配置以适配 webpack2 (enable tree-shaking,由 webpack 来做 module 格式的转换)
// 找到 ES2015 这个 preset,添加 { "modules": false }
// 注意后续可能要修改这边逻辑,考虑会对 import / export 进行转换的不一定只有 ES2015 这个 preset
// 找到 es2015 这个 preset,添加 { "modules": false }
// 注意后续可能要修改这边逻辑,考虑会对 import / export 进行转换的不一定只有 es2015 这个 preset
const adaptBabelLoaderOptions = options => {
if (!options || !options.presets) {
return options
Expand All @@ -29,11 +29,11 @@ const adaptBabelLoaderOptions = options => {
presets: {
$set: options.presets.map(
preset => {
if (preset === 'ES2015') {
return ['ES2015', { 'modules': false }]
if (preset === 'es2015') {
return ['es2015', { 'modules': false }]
}
if (preset && preset[0] === 'ES2015') {
return ['ES2015', utils.extend({}, preset[1], { 'modules': false })]
if (preset && preset[0] === 'es2015') {
return ['es2015', utils.extend({}, preset[1], { 'modules': false })]
}
return preset
}
Expand Down
2 changes: 1 addition & 1 deletion preset-configs/vue.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"transformer": "vue",
"config": {
"loaders": {
"js": "babel-loader?{\"presets\":[[\"ES2015\"]]}"
"js": "babel-loader?{\"presets\":[[\"es2015\"]]}"
}
}
}
Expand Down