Comments (5)
i was able to get things to work with this
optimization: {
splitChunks: {
cacheGroups: {
commons: {
test: /[\\/]node_modules[\\/]cesium/,
name: 'Cesium',
chunks: 'all'
}
}
}
}
Note I have the following also in webpack
output: {
path: path.resolve(__dirname, "Bundle"),
filename: "[name].bundle.js",
// Needed to compile multiline strings in Cesium
sourcePrefix: ''
},
and it created the file Cesium.bundle.js
from cesium-webpack-example.
+1
from cesium-webpack-example.
+1 also
from cesium-webpack-example.
Just to add a bit more ontop of this if you want your other node modules separately chunked:
splitChunks({
cacheGroups: {
vendors: {
name: `chunk-vendors`,
test: /[\\/]node_modules[\\/]/,
priority: -10,
chunks: 'initial'
},
commons: {
name: 'Cesium',
test: /[\\/]node_modules[\\/]cesium/,
chunks: 'all'
}
}
})
from cesium-webpack-example.
ol-cesium-webpack-example 下载下来,直接运行 npm i 会报错, 由于我的环境是webpack4.,所以将package文件中的配置修改为webpack4., 运行npm i 正常;
npm start 启动也失败,找不到js文件,于是修改webpack.config.js配置,增加了goog路径,运行成功.
ol-cesium-webpack4-example-master.zip
from cesium-webpack-example.
Related Issues (20)
- Include loaders for binary files like glb and wasm HOT 7
- Base url issue HOT 1
- Update for webpack4, latest cesium, and optionally vue.js? HOT 7
- Build is broken on master HOT 7
- webpack 5 example HOT 1
- module rules must have exclude: /node_modules/
- webpack >= v2.0.0 support json by default, so should omit json load configuration in webpack.config.js
- CesiumJS & Webpack Guide HOT 1
- Cesium definitely doesn't work with ES6 !!!
- Images/TimelineIcons.png is not showing
- FYI: Created a Vite example
- how to use the build version of cesium HOT 1
- createWorldTerrain not found in cesium HOT 3
- Cesium 1.110 webpack update HOT 3
- Can this allow me to use the latest version of cesium on nuxt2?
- Update the webpack tutorial with latest changes
- Is CESIUM_BASE_URL even still involved in worker setup and do they still need to be copied around? HOT 2
- Remove external node dependencies HOT 1
- Update TUTORIAL.md for new async API
- Include Node polyfill config HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cesium-webpack-example.