__webpack_require__(...)isnotafunction 使⽤webpack.DllReferencePlugin打包vue报错
之后看了官⽅⽂档,多写⼀个context属性,在打包运⾏就OK了
⽣成DLL⽂件的配置⽂件 fig.js
const path = require('path')
const webpack = require('webpack')
mode: 'development',
entry: {
vue: [
'vue/dist/vue.js',
'vue-router'
]
},
output: {resolve a doi name
path: solve(__dirname, '../dist'),
filename: '[name]_dll.js',
library: '[name]_dll' // 会在全局暴露出vue_dll对象
},
plugins: [
new webpack.DllPlugin({
context: __dirname,
name: '[name]_dll',
path: solve(__dirname, '../dist/manifest.json')
})
]
}
webpack打包配置⽂件 fig.js
插件中
new webpack.DllReferencePlugin({
context: __dirname,
manifest: solve(__dirname, '../dist/manifest.json')
}),
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论