Skip to content

Commit

Permalink
fix(cli-service): prevent sub-process to interference polyfill injection
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcz committed Jun 17, 2020
1 parent 38c821a commit 661fed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@vue/cli-service/bin/vue-cli-service.js
Expand Up @@ -10,6 +10,7 @@ if (!semver.satisfies(process.version, requiredVersion)) {
)
process.exit(1)
}
process.env.VUE_CLI_MAIN_PROCESS_PID = process.pid

const Service = require('../lib/Service')
const service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd())
Expand Down
4 changes: 3 additions & 1 deletion packages/@vue/cli-service/lib/Service.js
Expand Up @@ -292,7 +292,9 @@ module.exports = class Service {
}

entryFiles = entryFiles.map(file => path.resolve(this.context, file))
process.env.VUE_CLI_ENTRY_FILES = JSON.stringify(entryFiles)
if (process.env.VUE_CLI_MAIN_PROCESS_PID === process.pid) {
process.env.VUE_CLI_ENTRY_FILES = JSON.stringify(entryFiles)
}
}

return config
Expand Down

0 comments on commit 661fed9

Please sign in to comment.