Dva: sass 配置好,为什么不生效?

Created on 6 Jun 2017  ·  3Comments  ·  Source: dvajs/dva

webpack.config.js:
webpackConfig.module.loaders.push({ test: /\.scss$/, loaders: [ 'style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass' ] });

..这个insert code 怎么回事,死活弄不好格式

之后index.js 引入sass, 给组件加上className,就是找不到风格,
npm run build,查看index.css 大小跟没导入sass之前一模一样

Most helpful comment

webpackConfig.module.loaders.push({
test: /.scss$/,
loader: _extractTextWebpackPlugin.extract('style', 'css!postcss!sass')
})
if (env == "development") {
webpackConfig.plugins.push(new _extractTextWebpackPlugin('[name].css'));
}

目前解决方案,等作者加 sass:true

All 3 comments

webpackConfig.module.loaders.push({
test: /.scss$/,
loader: _extractTextWebpackPlugin.extract('style', 'css!postcss!sass')
})
if (env == "development") {
webpackConfig.plugins.push(new _extractTextWebpackPlugin('[name].css'));
}

目前解决方案,等作者加 sass:true

你这个配置好了嘛 我现在sass配置不行@sorrycc

Was this page helpful?
0 / 5 - 0 ratings