0
我設計了一種旨在導入爲<script>
標籤暴露了一個全球性的,就像一個JavaScript庫:的WebPack暴露錯誤的塊存儲爲庫
<script src="mapboard.js"></script>
<script>
Mapboard({...});
</script>
我使用的WebPack捆綁和分發。我的配置是這樣的:
module.exports = {
entry: {
lib: './src/main.js',
vendor: [
'leaflet',
'vue',
'vuex'
],
},
output: {
path: path.resolve(__dirname, './dist'),
publicPath: '/dist/',
filename: '[name].js',
library: 'Mapboard'
}
我想使它所以全球Mapboard
只露出大塊lib
。目前它由於某種原因暴露了其中一個供應商庫(vuex
)。有誰知道如何做到這一點?