标签:style try lib reference filename module info 图片 cti
使用webpack.DllReferencePlugin打包vue报错
之后看了官方文档,多写一个context属性,在打包运行就OK了
生成DLL文件的配置文件 webpack.vendor.config.js
const path = require(‘path‘) const webpack = require(‘webpack‘) module.exports = { mode: ‘development‘, entry: { vue: [ ‘vue/dist/vue.js‘, ‘vue-router‘ ] }, output: { path: path.resolve(__dirname, ‘../dist‘), filename: ‘[name]_dll.js‘, library: ‘[name]_dll‘ // 会在全局暴露出vue_dll对象 }, plugins: [ new webpack.DllPlugin({ context: __dirname, name: ‘[name]_dll‘, path: path.resolve(__dirname, ‘../dist/manifest.json‘) }) ] }
webpack打包配置文件 webpack.config.js
插件中
new webpack.DllReferencePlugin({ context: __dirname, manifest: path.resolve(__dirname, ‘../dist/manifest.json‘) }),
__webpack_require__(...) is not a function
标签:style try lib reference filename module info 图片 cti
原文地址:https://www.cnblogs.com/steamed-twisted-roll/p/12165648.html