creating a less bundle with webpack

2019-08-04 18:15发布

I need to create a bundle.less file with webpack that behaves the same as less-loader + exctract text plugin EXCEPT that it should not compile less into css, only concatenate all the required less files and inline the less imports.

The reason is that I have some variable that will be resolved at runtime (to allow the user to customize the application theme) but I want to ship in production bundled resources instead of the whole source file collection.

Is there a way to do that with existing plugin or do I need to write a webpack plugin (which I would rather avoid)?

标签: webpack less
1条回答
霸刀☆藐视天下
2楼-- · 2019-08-04 18:54

In the end I decided to create a custom webpack loader that recursively inline less imports.

查看更多
登录 后发表回答