mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-30 00:41:12 -05:00
fix(build): --target app should respect inline entry as well
close #1533
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
const defaults = {
|
||||
clean: true,
|
||||
target: 'app',
|
||||
entry: 'src/App.vue'
|
||||
target: 'app'
|
||||
}
|
||||
|
||||
const buildModes = {
|
||||
@@ -23,12 +22,15 @@ module.exports = (api, options) => {
|
||||
'--watch': `watch for changes`
|
||||
}
|
||||
}, async function build (args) {
|
||||
args.entry = args.entry || args._[0]
|
||||
for (const key in defaults) {
|
||||
if (args[key] == null) {
|
||||
args[key] = defaults[key]
|
||||
}
|
||||
}
|
||||
args.entry = args.entry || args._[0]
|
||||
if (args.target !== 'app') {
|
||||
args.entry = args.entry || 'src/App.vue'
|
||||
}
|
||||
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
@@ -82,6 +84,9 @@ module.exports = (api, options) => {
|
||||
webpackConfig = require('./resolveWcConfig')(api, args, options)
|
||||
} else {
|
||||
webpackConfig = api.resolveWebpackConfig()
|
||||
if (args.entry && !options.pages) {
|
||||
webpackConfig.entry = { app: api.resolve(args.entry) }
|
||||
}
|
||||
}
|
||||
|
||||
// apply inline dest path after user configureWebpack hooks
|
||||
|
||||
Reference in New Issue
Block a user