mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[webpack] Define a minimal set of entrypoints (#13688)
GitOrigin-RevId: 1092a1e368834c19d26bde2e62cbb97bcaf1f25c
This commit is contained in:
@@ -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',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user