Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix polyfill injection when building app on multiple threads #5592

Merged
merged 2 commits into from Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/@vue/cli-service/__tests__/Service.spec.js
Expand Up @@ -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 => {
Expand Down
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_FILES &&
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)
}