为了账号安全,请及时绑定邮箱和手机立即绑定

使用了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:\Users\zsl08.000\Desktop\Vue-Webpack-todo\node_modules\webpack\lib\Chunk.js:460

                throw new Error(

                ^


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


正在回答

9 回答

npm install extract-text-webpack-plugin@next

3 回复 有任何疑惑可以回复我~
#1

慕慕1621191

安装之后报这个错 TypeError: extractedChunk.addGroup is not a function
2018-03-20 回复 有任何疑惑可以回复我~
#2

XPoet 提问者

非常感谢!
2018-04-09 回复 有任何疑惑可以回复我~
#3

无悔欲 回复 慕慕1621191

我也是,后端项目报这个错,但是前端安装完@next版本没报错
2018-04-18 回复 有任何疑惑可以回复我~
#4

慕UI5247180 回复 慕慕1621191

我也是相同的问题,请问你解决了吗
2018-05-25 回复 有任何疑惑可以回复我~
查看1条回复

npm install extract-text-webpack-plugin@next 正解, webpack 4+版本的问题解决了,感谢啊

2 回复 有任何疑惑可以回复我~

npm install extract-text-webpack-plugin@next 正解webpack4运行正常

2 回复 有任何疑惑可以回复我~

我的webpack是3.10.0的;使用npm install extract-text-webpack-plugin@next之后,执行webpack解决了

0 回复 有任何疑惑可以回复我~

楼上的方法都试过了,还是报错:

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

0 回复 有任何疑惑可以回复我~
#1

HatakeKkshi

我现在也报这个错误,你的解决了吗
2018-04-01 回复 有任何疑惑可以回复我~

对比一下你的package.json

{
  "name": "webpack-vue-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "cross-env NODE_ENV=production webpack --config webpack.config.js",
    "dev": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "autoprefixer": "^8.1.0",
    "babel-core": "^6.26.0",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.4",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-vue-jsx": "^3.7.0",
    "babel-preset-env": "^1.6.1",
    "cross-env": "^5.1.4",
    "css-loader": "^0.28.10",
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "file-loader": "^1.1.11",
    "html-webpack-plugin": "^3.0.6",
    "postcss-loader": "^2.1.1",
    "style-loader": "^0.20.3",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "url-loader": "^1.0.1",
    "vue": "^2.5.16",
    "vue-loader": "^14.2.1",
    "vue-template-compiler": "^2.5.16",
    "webpack": "^4.1.1",
    "webpack-cli": "^2.0.12",
    "webpack-dev-server": "^3.1.1"
  }
}

0 回复 有任何疑惑可以回复我~

   把这一段替换一下试试

config.plugins.push(
        new ExtractPlugin('styles.[contentHash:8].css'),
        // new webpack.optimize.CommonsChunkPlugin({
        //     name:'vendor'
        // })
    )

    config.optimization = {
        splitChunks: {
            cacheGroups: {
                commons: {
                    chunks: 'initial',
                    minChunks: 2, maxInitialRequests: 5,
                    minSize: 0
                },
                vendor: {
                    test: /node_modules/,
                    chunks: 'initial',
                    name: 'vendor',
                    priority: 10,
                    enforce: true
                }
            }
        },
        runtimeChunk: true
    }

0 回复 有任何疑惑可以回复我~

好的,我试试

0 回复 有任何疑惑可以回复我~

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

3 回复 有任何疑惑可以回复我~
#1

qq_心星_4

正解,赞
2021-07-30 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

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

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信