img.css 使用了一个相对路径
.img {
background: url('../images/panel.jpg')
}
被合并到主文件,成了这样
.img {
background: url(images/panel.jpg)
}
引号/双引号都被清除掉了,请问这个怎么解决?
?-url
可以保持您原本的輸入,不知道這樣是不是你想要的。下面是快速寫的一個範例
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: './index.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style", "css?-url")
}
]
},
plugins: [
new ExtractTextPlugin("[name].bundle.css")
]
}
另外根據 w3c 加 "
, '
和不加都是合法的用?root=..
也可以處理