Webpack, less-loader - Unexpected token - Why?

这一生的挚爱 提交于 2019-12-05 01:19:40

I was reviewing this page: https://webpack.github.io/docs/stylesheets.html in the excellent Webpack docs :-).

It shows: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader").

I tried this and it works! I get plain CSS in the output file.

I wasn't using ExtractTextPlugin.extract() correctly. The extract-text-webpack-plugin docs show that the first param is optional (the loader(s) that should be used when the css is not extracted), and the second param is loader string (the loader(s) that should be used for converting the resource to a css exporting module).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!