Skip to content

Commit 224ea12

Browse files
committed
added forced babel.config.js setup. will overwrite existing.
1 parent 7f7d035 commit 224ea12

File tree

5 files changed

+39
-11
lines changed

5 files changed

+39
-11
lines changed

generator/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,17 @@ module.exports = (api, options, rootOptions) => {
166166
const gitignorePath = api.resolve('.gitignore');
167167
const gitignoreWebpackConfig = api.resolve('.webpack.config.js');
168168

169-
// setup string replacement options for babel.config.js file
170-
if(api.hasPlugin('babel') && fs.existsSync('./babel.config.js')) {
171-
const replaceOptions = {
172-
files: './babel.config.js',
173-
from: ' \'@vue/app\'',
174-
to: ' process.env.VUE_PLATFORM === \'web\' ? \'@vue/app\' : {}, ' + newline + ' [\'@babel/env\', { targets: { esmodules: true } }]',
175-
}
176-
replace(replaceOptions, (err, changes) => {
177-
if (err) throw err;
178-
});
179-
}
169+
// // setup string replacement options for babel.config.js file
170+
// if(api.hasPlugin('babel') && fs.existsSync('./babel.config.js')) {
171+
// const replaceOptions = {
172+
// files: './babel.config.js',
173+
// from: ' \'@vue/app\'',
174+
// to: ' process.env.VUE_PLATFORM === \'web\' ? \'@vue/app\' : {}, ' + newline + ' [\'@babel/env\', { targets: { esmodules: true } }]',
175+
// }
176+
// replace(replaceOptions, (err, changes) => {
177+
// if (err) throw err;
178+
// });
179+
// }
180180

181181

182182
// for new projects that are native only, move files/dirs and delete others
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: ["@babel/plugin-syntax-dynamic-import"],
3+
presets: [
4+
process.env.VUE_PLATFORM === 'web' ? '@vue/app' : {},
5+
['@babel/env', { targets: { esmodules: true } }]
6+
]
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: ["@babel/plugin-syntax-dynamic-import"],
3+
presets: [
4+
process.env.VUE_PLATFORM === 'web' ? '@vue/app' : {},
5+
['@babel/env', { targets: { esmodules: true } }]
6+
]
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: ["@babel/plugin-syntax-dynamic-import"],
3+
presets: [
4+
process.env.VUE_PLATFORM === 'web' ? '@vue/app' : {},
5+
['@babel/env', { targets: { esmodules: true } }]
6+
]
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: ["@babel/plugin-syntax-dynamic-import"],
3+
presets: [
4+
process.env.VUE_PLATFORM === 'web' ? '@vue/app' : {},
5+
['@babel/env', { targets: { esmodules: true } }]
6+
]
7+
}

0 commit comments

Comments
 (0)