Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lessc with multiple plugins #3187

Closed
NaNDoon opened this issue Mar 15, 2018 · 2 comments
Closed

lessc with multiple plugins #3187

NaNDoon opened this issue Mar 15, 2018 · 2 comments

Comments

@NaNDoon
Copy link

NaNDoon commented Mar 15, 2018

Trying to run lessc with two plugins -- clean-css and autoprefixer. One out of every 5-6 times I execute the compiler like so:

lessc --plugin=clean-css="level=1" --plugin=autoprefix="ie 11,Edge >= 13,Chrome >= 47,Firefox >= 45,iOS >= 9.2,Safari >= 9" input.less output.css

I get this message:

undefinedError: Error setting options on plugin index.js
unrecognised clean-css option 'ie'

It appears that clean-css is trying to read the parameters of autoprefixer. When I reverse the order I get a similar error from autoprefixer. I've tried using --autoprefix and --clean-css directly instead of --plugin to no avail. Is there some kind of trick to preventing the either plugin from being "greedy" and reading each other's parameters? Is this a plugin-specific issue?

Thanks!

@cbettinger
Copy link

cbettinger commented Apr 6, 2018

Same here. My workaround is to use lessc twice - even if the output of the first call is CSS already.

"scripts": {
   "css": "lessc --autoprefix style.less style.css",
   "css:min": "npm run css && lessc --clean-css style.css style.css",
   ...
}

@matthew-dean
Copy link
Member

I was never able to reproduce this issue. I did however encounter a bug where those two Node.js plugins couldn't be loaded at all, so I'll make that PR and maybe you can re-check this. As far as I could tell, both plugins were only receiving their own options.

matthew-dean added a commit to matthew-dean/less.js that referenced this issue Jun 24, 2018
- Fixes multiple Node.js plugins not being loaded
matthew-dean added a commit to matthew-dean/less.js that referenced this issue Jun 24, 2018
matthew-dean added a commit to matthew-dean/less.js that referenced this issue Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants