0
我正试图在DLL之后放入一堆库文件,例如react-boilerplate和this one。未定义Webpack dll导入
当我构建并运行DLL文件时给出的是未定义的。 我可能失去了一些东西我做了一个分开的WebPack打造的DLL:
import webpack from 'webpack'
const library = '[name]'
export default {
entry: {
'lokka': ['lokka', 'lokka-transport-http', 'socket.io-client']
/** Other libs **/
},
output: {
filename: '[name].dll.js',
path: 'build/',
library: library
},
plugins: [
new webpack.DllPlugin({
path: 'build/[name]-manifest.json',
name: library
})
]
}
,并添加到manifest.json的
import webpack from 'webpack'
const desiredLibs = [
'lokka'
]
const plugins = desiredLibs.map((lib) => {
return new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require(`../build/${lib}-manifest.json`)
})
})
export const dllReference =() => {
return { plugins }
}
export default dllReference
的引用是否有别的我应该怎么办?
在我的情况下,它抱怨代码运行时找不到lokka。