mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-17 21:00:03 -06:00
fix: polyfill injection when building app on multiple threads (#5592)
This commit is contained in:
@@ -318,6 +318,8 @@ test('api: configureWebpack preserve ruleNames', () => {
|
||||
})
|
||||
|
||||
test('internal: should correctly set VUE_CLI_ENTRY_FILES', () => {
|
||||
delete process.env.VUE_CLI_ENTRY_FILES
|
||||
|
||||
const service = createMockService([{
|
||||
id: 'test',
|
||||
apply: api => {
|
||||
|
||||
@@ -279,7 +279,10 @@ module.exports = class Service {
|
||||
)
|
||||
}
|
||||
|
||||
if (typeof config.entry !== 'function') {
|
||||
if (
|
||||
!process.env.VUE_CLI_ENTRY_FILES &&
|
||||
typeof config.entry !== 'function'
|
||||
) {
|
||||
let entryFiles
|
||||
if (typeof config.entry === 'string') {
|
||||
entryFiles = [config.entry]
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user