我在ES6代码中引用了几个大的库,如下:
import "leaflet";
import { tiledMapLayer as esriMap } from "esri-leaflet";
import { tiledMapLayer as superMap } from "@supermap/iclient-leaflet";
我想做成cdn,在index.html里已经写好了script标签,打包时我就不想将这些库打包了,所以要配置webpack.base.conf.js下的externals,但做如下配置运行打包文件会报错:
leaflet:{
commonjs:'leaflet',
root:'L'
},
"esri-leaflet":{
commonjs:'tiledMapLayer'
},
"@supermap/iclient-leaflet":{
commonjs:'tiledMapLayer'
}
各位大神,帮我看看externals该怎么配