zoukankan      html  css  js  c++  java
  • webpack使用extract-text-webpack-plugin打包时提示错误

    Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

    解决办法

    npm install --save-dev extract-text-webpack-plugin@next 
    会下载到+ extract-text-webpack-plugin@4.0.0-beta.0 
    然后在打包就正常了

    "devDependencies": {
        ...
        "extract-text-webpack-plugin": "^4.0.0-beta.0",
        "html-webpack-plugin": "^3.2.0",
        "postcss-loader": "^2.1.4",
        "style-loader": "^0.21.0",
        "webpack": "^4.6.0",
         ...
      }



    1.使用了extract-text-webpack-plugin插件后,编译出错,信息如下,

    (node:9624) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

    (node:9624) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead

    C:Userszsl08.000DesktopVue-Webpack-todo ode_moduleswebpacklibChunk.js:460

                    throw new Error(

                    ^

    Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

    解决方案:用的应该是webpack4吧,换成mini-css-extract-plugin就好了,用法:https://www.npmjs.com/package/mini-css-extract-plugin

    2.使用new webpack.optimize.UglifyJsPlugin()时报错

    Error: webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead.

    解决方案:

    1.webpack内置的JS压缩插件不能使用了,可以安装uglifyjs-webpack-plugin插件,使用同其他非内置插件;

    2.--mode production 表示生产环境,只要配置在package.json的script里面 js自动就压缩了

    // Uglify是压缩js,现在已经不需要了,只需要在script里面写成
    // "build": "webpack --mode production", 就自动压缩了

     
  • 相关阅读:
    pom变成红橙色
    拉链表
    Newsgroups数据集研究
    python 安装第三方包
    概率图(三)CRF条件随机场
    概率图(二)马尔科夫随机场MRF
    LDA主题模型
    TF-IDF算法
    mysql 自定义排序顺序
    [转]解决a different object with the same identifier value was already associated with the session错误
  • 原文地址:https://www.cnblogs.com/cina33blogs/p/8933375.html
Copyright © 2011-2022 走看看