如何在Webpack中使用Sass眼镜? [英] How to use Sass Eyeglass with Webpack?
本文介绍了如何在Webpack中使用Sass眼镜?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将 Sass眼镜与
I would like to use Sass Eyeglass with Webpack. I have found very little information about it and is rather frustrating because I'm sure it can be done.
有人使用它有成功吗?
推荐答案
在最近的Webpack中,我设法使眼镜与sass-loader配合使用.
I managed to get eyeglass working with sass-loader in recent webpack.
Eyeglass为sass注入了自己的选项,您可以依次将它们作为选项传递给sass-loader:
Eyeglass injects its own options for sass which you can in turn pass as options to sass-loader:
[...]
{
test: /\.scss$/,
include: config.paths.assets,
use: ExtractTextPlugin.extract({
fallback: 'style',
publicPath: '../',
use: [
`css?${sourceMapQueryStr}`,
'postcss',
`resolve-url?${sourceMapQueryStr}`,
{
loader: `sass?${sourceMapQueryStr}`,
options: eyeglass({
// sass options...
includePaths: ['/share/scss/'],
eyeglass: {
// eyeglass options
}
})
}
],
}),
},
[...]
这篇关于如何在Webpack中使用Sass眼镜?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文