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

Source map option not working #6

Closed
bdgeorge opened this issue May 4, 2015 · 3 comments
Closed

Source map option not working #6

bdgeorge opened this issue May 4, 2015 · 3 comments

Comments

@bdgeorge
Copy link

bdgeorge commented May 4, 2015

I'm finding that the --source-map option doesn't work, I'm getting the following error:

Error setting options on plugin less-plugin-clean-css
unrecognised clean-css option '--source-map'
Unable to interpret argument clean-css - if it is a plugin (less-plugin-clean-css), make sure that it is     installed under or at the same level as less

This is after doing npm install -g less then npm install -g less-plugin-clean-css

If I install clean-css and run that alone it works as expected, so cleancss tmp.css --source-map --output tmp.min.css generates a cleaned file and the map.
However running lessc tmp.less tmp.css --clean-css="--source-map --output tmp.min.css" results in the error code given above.

Other options, eg lessc tmp.less tmp.css --clean-css="--s1" work fine.

I'm using [email protected] and [email protected]

@seven-phases-max
Copy link
Member

The plugin has no such option. To get the sourcemap you need to use this option for the lessc itself (plugin will inherit it automatically). There's no --output option too, as well as any other input/output/file options since the plugin works inside the compiler and all files are read/written by lessc. Run lessc --clean-css to see exact list of available options.

@bdgeorge
Copy link
Author

bdgeorge commented May 4, 2015

Thanks, got it working now - the confusion came from the deprecation warning I got after upgrading lessc The compress option has been deprecated. We recommend you use a dedicated css minifier, for instance see less-plugin-clean-css. and the following paragraph in the plugin's readme.md:

See clean-css for the available command options - the only differences are advanced and rebase which we default to false, because it is not always entirely safe.

So I went and checked out clean-css and their examples (which are all for the CLI) made it look like this plugin was acting as a wrapper to the clean-css cli command as clean-css itself has a --source-map and --output option :-)

Thanks for the quick response - all good now!

@ElTorterol
Copy link

Hi bdgeorge,
...please could you provide some more step_by_step instructions bout how you did to solve this issue?... (what commands we need to execute in Ubuntu terminal for example )
Thanks in advanced,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants