const HtmlModuleScriptWebpackPlugin = require('./HtmlModuleScriptWebpackPlugin');
// Must be shared across configurations
const htmlModuleScriptPlugin = new HtmlModuleScriptWebpackPlugin({
entrySuffix: '_modern'
});
// in your plugins section:
const plugins = [
// Make the HTML page load a modern build if the browser supports it, otherwise a legacy one
htmlModuleScriptPlugin,
// Creates index.html
new HtmlWebpackPlugin({
favicon: './src/favicon.ico',
title: 'React Starter'
})
];
module.exports = [
modernConfig, // with entry named "main_modern"
legacyConfig
];
/*
* You'll also need the "_modern" suffix on any other entry points, such as CommonsChunkPlugin ones
* used for separating a vendor chunk and/or runtime(manifest) chunk.
*/