美文网首页
webpack loader加载顺序

webpack loader加载顺序

作者: 火星X王子 | 来源:发表于2016-03-22 10:03 被阅读2629次

今天起server的时候发现,scss加载报错,仔细检查发现是loader顺序写错了,贴一个官网的例子:

require("!style!css!less!bootstrap/less/bootstrap.less");

//=> the file "bootstrap.less" in the folder "less" in the "bootstrap"

//module (that is installed from github to "node_modules") is

//transformed by the "less-loader". The result is transformed by the

//"css-loader" and then by the "style-loader".

//If configuration has some transforms bound to the file, they will not be applied.

写的很明确了,加载顺序是从后向前,比如要加载scss文件,要把scss写在最后

相关文章

网友评论

      本文标题:webpack loader加载顺序

      本文链接:https://www.haomeiwen.com/subject/efxllttx.html