设置Webpack的配置项,使其支持Cesium
build\webpack.base.conf.js配置如下:
output: {
path: config.build.assetsRoot,
filename: ‘[name].js’,
publicPath: process.env.NODE_ENV === ‘production’
-
? config.build.assetsPublicPath
- config.dev.assetsPublicPath,
sourcePrefix: ’ '//让Webpack正确缩进多行字符串。
},
build\webpack.base.conf.js配置如下:
module: {
rules: [
…
],
unknownContextRegExp: /^./.*$/,//Webpack打印载入特定库时候的警告
unknownContextCritical: false,//解决错误Error: Cannot find module “.”
}
此时npm run dev运行 控制台报错:
./node_modules/so