XPoet
2018-03-08 18:23
(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
npm install extract-text-webpack-plugin@next
npm install extract-text-webpack-plugin@next 正解, webpack 4+版本的问题解决了,感谢啊
npm install extract-text-webpack-plugin@next 正解webpack4运行正常
我的webpack是3.10.0的;使用npm install extract-text-webpack-plugin@next之后,执行webpack解决了
楼上的方法都试过了,还是报错:
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
对比一下你的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"
}
}
把这一段替换一下试试
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
}
好的,我试试
你用的应该是webpack4吧,换成mini-css-extract-plugin就好了,用法:https://www.npmjs.com/package/mini-css-extract-plugin
Vue+Webpack打造todo应用
84606 学习 · 787 问题
相似问题