Tapable.plugin is deprecated. Use new API on `.hooks` instead
来源:5-3 服务端渲染的entry配置

warzsy
2018-09-07
extract-text-webpack-plugin换成mini-css-extract-plugin了还是报这个错误
webpack.config.server.js 代码:
const path = require(‘path’)
const webpack = require(‘webpack’)
const merge = require(‘webpack-merge’)
const baseConfig = require(’./webpack.config.base’)
const VueServerPlugin = require(‘vue-server-renderer/server-plugin’)
const VueLoaderPlugin = require(‘vue-loader/lib/plugin’)
const MiniCssExtractPlugin = require(“mini-css-extract-plugin”)
let config
config = merge(baseConfig,{
target: ‘node’,
entry: path.join(__dirname, ‘…/client/server-entry.js’),
devtool: ‘source-map’,
output: {
libraryTarget: ‘commonjs2’,
filename: ‘server-entry.js’,
path: path.join(__dirname, ‘…/server-build’)
},
externals: Object.keys(require(’…/package.json’).dependencies),
module:{
rules:[
{
test: /.styl/,
use: [
{
loader:MiniCssExtractPlugin.loader,
options:{
publicPath: ‘…/’
}
},
‘css-loader’,
{
loader:‘postcss-loader’,
options:{
sourceMap:true,
}
},
‘stylus-loader’
]
},
{
test: /.css$/,
use: [
‘vue-style-loader’,
{
loader: ‘css-loader’,
options: {
// enable CSS Modules
modules: true,
// customize generated class names
localIdentName: ‘[path]-[name]-[hash:base64:5]’,
camelCase:true
}
}
]
}
]
},
plugins: [
// new ExtractPlugin(‘styles.[chunkhash:8].css’),
new webpack.DefinePlugin({
‘process.env.NODE_ENV’: JSON.stringify(process.env.NODE_ENV || ‘development’),
‘process.env.VUE_ENV’: ‘“server”’
}),
new VueServerPlugin(),
new VueLoaderPlugin(),
new MiniCssExtractPlugin({
filename: “[name].css”,
})
]
})
module.exports = config
webkack版本:4.17.2 (最新)
5回答
-
这个提醒本身不会导致错误啊,现在版本的webpack还是支持老的API的,只是会在下个版本移除。这么看我也是看不出哪里的问题,你也没必要特别在意
012018-09-11 -
叶赫那拉鬼龙
2019-02-18
我是把这三个的版本号改成一样的 就没有这个提示了
00 -
夜尽天明4039292
2018-10-19
遇到同样的问题,请问你解决了吗,怎么解决的呢?00 -
Jokcy
2018-09-10
另外如果你确定是VueServerPlugin的问题,可以去github找issue或者你自己提一个
00 -
Jokcy
2018-09-08
这是插件版本没有更新,用的老的webpack版本api的原因,你可以升级一下插件
052018-10-23
相似问题