搜索
您的当前位置:首页正文

webpack loader加载顺序

来源:知库网

今天起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写在最后

Top