Microbundle: How can i use less-loader

Created on 17 Jun 2020  路  4Comments  路  Source: developit/microbundle

i need use less-loader,but i found that the postcss config is fixed,and I could only use CSS configuration.

file: node_modules/microbundle-crl/src/index.js

image

wontfix

Most helpful comment

I'm going to close this out as wontfix since Microbundle is specifically not trying to be a general-purpose configurable bundler, and this falls into that territory. Please let me know though if the above doesn't work.

All 4 comments

Hiya - this is not webpack, so less-loader is not available. However, less and sass are both supported by default, you simply need to install the relevant processor:

npm i -D less

Now you can import .less files.

I'm going to close this out as wontfix since Microbundle is specifically not trying to be a general-purpose configurable bundler, and this falls into that territory. Please let me know though if the above doesn't work.

Hello @developit , I tried with your approach but stuck with an error like below:

$ microbundle --no-compress --format modern,cjs
(postcss plugin) Error: Inline JavaScript is not enabled. Is it set in your options?

I understood that I need to set javascriptEnabled: true as what we usually do for webpack less-loader, but I can't find how to handle it with microbundle, can shed some light on this? Thank you very much!

You'd have to find a dotfile used by rollup-plugin-postcss. Microbundle does not allow customization of CSS beyond filenames.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kikobeats picture Kikobeats  路  4Comments

jlkiri picture jlkiri  路  4Comments

yaymukund picture yaymukund  路  4Comments

developerdizzle picture developerdizzle  路  5Comments

manferlo81 picture manferlo81  路  5Comments