我对 Angular 2 和 webpack 有疑问。问题是,如果我在我的 css 文件中使用相对路径,例如“background: url("./../images/squares.gif") center left no-repeat;” 构建应用程序时出现错误:
“15% 19/206 build modulesModuleBuildError: Module build failed: SyntaxError: Unexpected token ILLEGAL”
我的 webpack 配置是:
loaders: [
...
{
test: /\.css$/,
exclude: helpers.root('src', 'app'),
loaders:[ExtractTextPlugin.extract('style', 'css-loader'), 'to-string', 'css']
},
{
test: /\.css$/,
include: helpers.root('src', 'app'),
loader: ['raw']
}
...
]
有谁能够帮我?
提前致谢!