使用了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
2018-03-20
npm install extract-text-webpack-plugin@next
2018-05-03
npm install extract-text-webpack-plugin@next 正解, webpack 4+版本的問題解決了,感謝啊
2018-04-27
npm install extract-text-webpack-plugin@next 正解webpack4運行正常
2018-04-01
我的webpack是3.10.0的;使用npm install extract-text-webpack-plugin@next之后,執行webpack解決了
2018-03-30
樓上的方法都試過了,還是報錯:
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
2018-03-20
對比一下你的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"
? }
}
2018-03-20
?? 把這一段替換一下試試
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
??? }
2018-03-12
好的,我試試
2018-03-12
你用的應該是webpack4吧,換成mini-css-extract-plugin就好了,用法:https://www.npmjs.com/package/mini-css-extract-plugin