0
試圖創造的WebPack 2個供應商捆綁,當我跑服務器將最終的腳本發生此錯誤:多的WebPack廠商捆綁
vendor1.369f8f5….js:1 Uncaught TypeError: Cannot read property 'call' of undefined
at t (vendor1.369f8f5….js:1)
at Object.<anonymous> (main.369f8f5….js:1)
at Object.<anonymous> (main.369f8f5….js:1)
at t (vendor1.369f8f5….js:1)
at Object.<anonymous> (main.369f8f5….js:6)
at t (vendor1.369f8f5….js:1)
at window.webpackJsonp (vendor1.369f8f5….js:1)
at window.webpackJsonp (vendor2.369f8f5….js:1)
at main.369f8f5….js:1
這是我webpack.config:
entry: {
/* Material Design Lite (https://getmdl.io) */
// '!!style-loader!css-loader!react-mdl/extra/material.min.css',
// 'react-mdl/extra/material.min.js',
/* The main entry point of your JavaScript application */
main:'./main.js',
vendor1:['react','router','mixpanel-browser','react-dom','preact','preact-compat'],
vendor2:['core-js','fastclick','whatwg-fetch','axios',],
// vendor3:['core-js'],
// vendor4:['mixpanel-browser'],
},
.. ...
new webpack.optimize.CommonsChunkPlugin({
name: "vendor1",
chunks:['main'],
minChunks:Infinity,
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendor2",
chunks:['main'],
minChunks:Infinity,
}),
當我只有一個供應商和一個主包時,這很好。但是,我無法爲較小的文件大小創建第二個供應商捆綁軟件。已經在網上搜索解決方案,但沒有任何工作。也許它與我的語法有關?
是否找到任何解決方案? – ArtemSky
@ArtemSky nope。我不得不與兩個捆綁到底,不能分割更多。 – whales