mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
[webpack] Define a minimal set of entrypoints (#13688)
GitOrigin-RevId: 1092a1e368834c19d26bde2e62cbb97bcaf1f25c
This commit is contained in:
parent
bbbf38d76b
commit
2665c5598b
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,17 @@ process.env.REACT_REFRESH = '1'
|
|||
|
||||
const base = require('./webpack.config')
|
||||
|
||||
// if WEBPACK_ENTRYPOINTS is defined, remove any entrypoints that aren't included
|
||||
if (process.env.WEBPACK_ENTRYPOINTS) {
|
||||
const entrypoints = new Set(process.env.WEBPACK_ENTRYPOINTS.split(/\s*,\s*/))
|
||||
console.log(`Building entrypoints ${[...entrypoints].join(',')}`)
|
||||
for (const entrypoint in base.entry) {
|
||||
if (!entrypoints.has(entrypoint)) {
|
||||
delete base.entry[entrypoint]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = merge(base, {
|
||||
mode: 'development',
|
||||
|
||||
|
|
Loading…
Reference in a new issue