Created
November 30, 2023 14:13
-
-
Save sibelius/75a4ef146d886a48fcf5ed96b33d5c29 to your computer and use it in GitHub Desktop.
trying to bundle many frontends in a single webpack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = merge(rspackDevConfig, { | |
entry: { | |
main: './src/index.tsx', | |
login: '../login/src/index.tsx', | |
console: '../console/src/index.tsx', | |
}, | |
devServer: { | |
port: PORT, | |
...getOpen('/home'), | |
...getProxy(), | |
historyApiFallback: { | |
disableDotRule: true, | |
rewrites: [ | |
{ from: /^\/home\/.*$/, to: '/home/index.html' }, | |
{ from: /^\/login\/.*$/, to: '/login/index.html' }, | |
{ from: /^\/console\/.*$/, to: '/console/index.html' }, | |
], | |
}, | |
}, | |
watchOptions: getWebpackWatchOptions(getIgnoredEntrypoints('main')), | |
plugins: [ | |
new rspack.HtmlRspackPlugin({ | |
template: path.join(cwd, './src/index.html'), | |
publicPath: '/home', | |
chunks: ['main'], | |
}), | |
new rspack.HtmlRspackPlugin({ | |
template: path.join(cwd, '../login/src/index.html'), | |
publicPath: '/login', | |
chunks: ['login'], | |
}), | |
new rspack.HtmlRspackPlugin({ | |
template: path.join(cwd, '../console/src/index.html'), | |
publicPath: '/console', | |
chunks: ['console'], | |
}), | |
], | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment