• webpack3升级webpack4


    cnpm i webpck@4 webpack-cli -D

    cnpm i webpack-cli -D

    cnpm update

    
    

    npm WARN deprecated extract-text-webpack-plugin@3.0.2: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin
    npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

    删除
    // "extract-text-webpack-plugin": "^3.0.2",
    cnpm install mini-css-extract-plugin -D  //^0.8.0
     
    升级 
    webpack-dev-server
    "webpack-dev-server": "^3.8.2"
     
    • rm -rf node_modules
    • rm package-lock.json
    • npm cache clear --force
    • npm install

    Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.

    升级

    "vue-loader": "^13.0.5", =》 
    "vue-loader": "^15.7.1",
     
    vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config
     
    const VueLoaderPlugin = require('vue-loader/lib/plugin')
    plugins: [
      // make sure to include the plugin for the magic
      new VueLoaderPlugin()
    ],
     
    升级
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-plugin-import": "^1.7.0",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-preset-env": "^1.6.0",
    "babel-preset-stage-3": "^6.24.1",
    =》
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-plugin-import": "^1.12.2",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-stage-3": "^6.24.1",
     
    file-loader:^2.0.0
    webpack-cli:^3.1.2
    webpack:^4.25.1
     
    TypeError: CleanWebpackPlugin is not a constructor
    Time: 9631ms
  • 相关阅读:
    C++ 修改常量的值
    Android Studio 使用入门
    Ubuntu14.04下配置固定IP
    vi/vim 按键说明
    linux下文件夹的创建、复制、剪切、重命名、清空和删除命令
    linux中的find命令——查找文件名
    shell 脚本编写基础
    linux C程序中获取shell脚本输出(如获取system命令输出)
    vi 技巧
    理解Linux中的shutdown、poweroff、halt和reboot命令
  • 原文地址:https://www.cnblogs.com/zhoudawei/p/11633102.html
Copyright © 2020-2023  润新知