splitchunks in webpack 4
See original GitHub issueFrom https://github.com/AnalyticalGraphicsInc/cesium/issues/6610
In the cesium and webpack tutorial (https://cesiumjs.org/tutorials/cesium-and-webpack/), there is a section about code splitting which uses webpack.optimize.CommonsChunkPlugin. However, in the new webpack 4 this has been deprecated, so you get this error:
ERROR Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.
I can’t seem to work out the correct syntax for using splitChunks with cesium, it would be very helpful to add this to the tutorial.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
SplitChunksPlugin
splitChunks.chunks. string = 'async' function (chunk). This indicates which chunks will be selected for optimization. When a string is provided, ...
Read more >Webpack 4 — Mysterious SplitChunks Plugin
Webpack 4 — Mysterious SplitChunks Plugin ... The official release of Webpack-4 boasts about the proven faster build time (around 98%) and reduced ......
Read more >Demystifying Webpack 4 Split Chunks Plugin
Recently, we migrated one of our web apps to the Webpack 4, which decreases build time and reduces chunk size by using Split...
Read more >Webpack 4 and splitChunks - move all vendor code to a ...
I'm trying to configure the splitChunks plugin so it would output: app chunk including src code without dependencies and packages;; module1 ...
Read more >Webpack: An in-depth introduction to SplitChunksPlugin
optimization: { // Instruct webpack not to obfuscate the resulting code minimize: false, splitChunks: { minSize: 0, chunks: 'all', minChunks: 4, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i was able to get things to work with this
Note I have the following also in webpack output: { path: path.resolve(__dirname, “Bundle”), filename: “[name].bundle.js”,
and it created the file Cesium.bundle.js
ol-cesium-webpack-example 下载下来,直接运行 npm i 会报错, 由于我的环境是webpack4.,所以将package文件中的配置修改为webpack4., 运行npm i 正常; npm start 启动也失败,找不到js文件,于是修改webpack.config.js配置,增加了goog路径,运行成功. ol-cesium-webpack4-example-master.zip