diff --git a/packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js b/packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js index 3e98d3cab3..58256acc01 100644 --- a/packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js +++ b/packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js @@ -1,4 +1,16 @@ module.exports = (api, args, options) => { + // respect inline entry + if (args.entry && !options.pages) { + api.chainWebpack(config => { + config.entryPoints + .clear() + + config + .entry('app') + .add(api.resolve(args.entry)) + }) + } + const config = api.resolveChainableWebpackConfig() const targetDir = api.resolve(args.dest || options.outputDir) @@ -36,14 +48,5 @@ module.exports = (api, args, options) => { } } - const rawConfig = api.resolveWebpackConfig(config) - - // respect inline entry - if (args.entry && !options.pages) { - const entry = api.resolve(args.entry) - rawConfig.entry = { app: entry } - process.env.VUE_CLI_ENTRY_FILES = JSON.stringify([entry]) - } - - return rawConfig + return api.resolveWebpackConfig(config) }