PDA

View Full Version : ExtReactWebpackPlugin and chunks in webpack.config



timmkd
25 Mar 2018, 4:42 PM
I am trying to give my app multiple entry points for a multipage app using chunks in my webpack.config file.

I am finding that when I do with with HtmlWebpackPlugin in my webpack.config.js, the compiler stops adding my extReact css and js files to my html. It seems this might be because the ExtReactWebpackPlugin is adding chunks to my HtmlWebpackPlugin compiler. Is this the case?

My code:

plugins.push(new HtmlWebpackPlugin({
template: 'index.html',
hash: true,
chunks: ['common, app']
}), new HtmlWebpackPlugin({
template: 'index.html',
hash: true,
chunks: ['common', 'login'],
filename: 'login.html'
}));


I seem to only be able to add my required entry point chunks when I exclude the chunks I don't want which seems counterintuitive, especially if I want to add more pages:

plugins.push(new HtmlWebpackPlugin({
template: 'index.html',
hash: true,
excludeChunks: ['login']
}), new HtmlWebpackPlugin({
template: 'index.html',
hash: true,
excludeChunks: ['app'],
filename: 'login.html'
}));

Is this because ExtreactWebpackPlugin is adding it's own chunks that I need to name?

timmkd
2 Apr 2018, 6:07 PM
Not sure if any Sencha guys have been able to see this?