Skip to content

Commit

Permalink
fix(cli-service): fix polyfill injection when building app on multipl…
Browse files Browse the repository at this point in the history
…e threads
  • Loading branch information
dtcz committed Jun 18, 2020
1 parent a41cac2 commit 1b8cf66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
5 changes: 4 additions & 1 deletion packages/@vue/cli-service/lib/Service.js
Expand Up @@ -279,7 +279,10 @@ module.exports = class Service {
)
}

if (typeof config.entry !== 'function') {
if (
!process.env.VUE_CLI_ENTRY_FILE &&
typeof config.entry !== 'function'
) {
let entryFiles
if (typeof config.entry === 'string') {
entryFiles = [config.entry]
Expand Down
18 changes: 8 additions & 10 deletions packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js
@@ -1,4 +1,11 @@
module.exports = (api, args, options) => {
// respect inline entry
if (args.entry && !options.pages) {
api.configureWebpack(config => {
config.entry = { app: api.resolve(args.entry) }
})
}

const config = api.resolveChainableWebpackConfig()
const targetDir = api.resolve(args.dest || options.outputDir)

Expand Down Expand Up @@ -36,14 +43,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)
}

0 comments on commit 1b8cf66

Please sign in to comment.