Skip to content

Commit 1b8cf66

Browse files
committed
fix(cli-service): fix polyfill injection when building app on multiple threads
1 parent a41cac2 commit 1b8cf66

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

packages/@vue/cli-service/lib/Service.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ module.exports = class Service {
279279
)
280280
}
281281

282-
if (typeof config.entry !== 'function') {
282+
if (
283+
!process.env.VUE_CLI_ENTRY_FILE &&
284+
typeof config.entry !== 'function'
285+
) {
283286
let entryFiles
284287
if (typeof config.entry === 'string') {
285288
entryFiles = [config.entry]

packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
module.exports = (api, args, options) => {
2+
// respect inline entry
3+
if (args.entry && !options.pages) {
4+
api.configureWebpack(config => {
5+
config.entry = { app: api.resolve(args.entry) }
6+
})
7+
}
8+
29
const config = api.resolveChainableWebpackConfig()
310
const targetDir = api.resolve(args.dest || options.outputDir)
411

@@ -36,14 +43,5 @@ module.exports = (api, args, options) => {
3643
}
3744
}
3845

39-
const rawConfig = api.resolveWebpackConfig(config)
40-
41-
// respect inline entry
42-
if (args.entry && !options.pages) {
43-
const entry = api.resolve(args.entry)
44-
rawConfig.entry = { app: entry }
45-
process.env.VUE_CLI_ENTRY_FILES = JSON.stringify([entry])
46-
}
47-
48-
return rawConfig
46+
return api.resolveWebpackConfig(config)
4947
}

0 commit comments

Comments
 (0)