I have multiple entrypoints in my project which have different chunks (for example a vendor chunk). Now the issue is that my entrypoints don't work without implicitly importing the vendor chunk and the runtime file.
What I have to do
<script defer="defer" src="runtime.js"></script>
<script defer="defer" src="399.js"></script>
<script defer="defer" src="standalone.js"></script>
What I want to do
<script defer="defer" src="standalone.js"></script>
How can I make it so by just importing standalone.js it automatically imports runtime.js and 399.js without having to implicitly do this in the html file. Can this be done?
Config
module.exports = {
entry: {
standalone: path.resolve(__dirname, '../src/index.standalone.tsx')
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
output: {
path: path.resolve(__dirname, '..', './build')
},
optimization: {
runtimeChunk: 'single',
splitChunks: {
chunks: 'all'
}
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, '..', './public/index.standalone.html')
})
]
};