-
-
Save gaearon/ca6e803f5c604d37468b0091d9959269 to your computer and use it in GitHub Desktop.
Webpack code splitting configuration example
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 = { | |
entry: { | |
main: './src/app.js', | |
}, | |
output: { | |
// `filename` provides a template for naming your bundles (remember to use `[name]`) | |
filename: '[name].bundle.js', | |
// `chunkFilename` provides a template for naming code-split bundles (optional) | |
chunkFilename: '[name].bundle.js', | |
// `path` is the folder where Webpack will place your bundles | |
path: './dist', | |
// `publicPath` is where Webpack will load your bundles from (optional) | |
publicPath: 'dist/' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
React 16.14.0 + Webpack v5, React Lazy kick-off example : https://github.com/mrdulin/react-examples/tree/main/v16