码迷,mamicode.com
首页 > Web开发 > 详细

__webpack_require__(...) is not a function

时间:2020-01-08 12:32:09      阅读:519      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!