Luc*_*cia 3 sass loader webpack webpack-style-loader
So according to this question, css-loader loads file as string, resolves webpack dependency according to require, and style-loader inserts style tag into page, and in many cases, css-loader can be replaced by raw-loader.
I'm currently using:
loader: ExtractTextPlugin.extract("raw-loader!postcss-loader!sass-loader?sourceMap&" + sassIncludePaths.join(""))
Run Code Online (Sandbox Code Playgroud)
And there are requires in the .scss files, but I don't see a problem with raw-loader yet. So question is:
css-loader with raw-loader in order to reduce run time? 从我自己的理解:
raw-loader和之间的主要区别在于,css-loader前者按原样加载文件,而后者按webpack排序require。因此,通常的用例css-loader是将其与结合使用style-loader,从而在页面中插入一个标记,从而使其仅包含该页面上使用的样式。
但是,在我们的情况下,extractTextPlugin无论如何我们都将它们放入一个文件中,因此我们可以只使用raw-loader来节省几乎一半的时间。
同样,它也sass-loader解决了@imports,这是我们正在使用的唯一依赖项,因此设置应该是正确的。
| 归档时间: |
|
| 查看次数: |
2219 次 |
| 最近记录: |