vue迁移到webpack2,已按迁移文档编写配置如下
我的配置:
webpackConfig.module = {
rules : [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader",
publicPath: "./dist"
})
}
]
};
版本:
"extract-text-webpack-plugin": "^2.1.0",
还是报错:
ERROR in ./app.js
Module not found: Error: Can't resolve 'style' in '/mnt/vhost/github/easy-vue'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'style-loader' instead of 'style'.
@ ./app.js 3:0-54
@ multi ./app.js
ERROR in ./app.js
Module not found: Error: Can't resolve 'style' in '/mnt/vhost/github/easy-vue'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'style-loader' instead of 'style'.
@ ./app.js 4:0-55
@ multi ./app.js
ERROR in ./app.js
Module not found: Error: Can't resolve 'style' in '/mnt/vhost/github/easy-vue'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
You need to specify 'style-loader' instead of 'style'.
@ ./app.js 5:0-45
@ multi ./app.js
你用的是这个叫做easy-vue的库是吧?
我看到里面这
app.js
里的头三句就用了style-loader
的:要注意的是,loader不是只有在webpack配置文件里做全局配置的,而是还可以在具体require/import的时候指定的