Webpack 项目中
vue工程使用webpack,增加了cesium依赖,启动时会输出下面的警告信息:
WARNING Compiled with 3 warnings 4:26:41 PM
warning in ./node_modules/cesium/Source/Core/buildModuleUrl.js
114:14-21 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
warning in ./node_modules/cesium/Source/Core/buildModuleUrl.js
52:12-19 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
warning in ./node_modules/cesium/Source/Core/buildModuleUrl.js
80:25-32 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
解决办法是修改webpack.base.conf.js,如果是vue-cli工程则是修改vue.config.js,增加如下的内容: