punch
punch copied to clipboard
Less @imports
I can't seem to get Less @import
s to work, I get the following error when trying to do @import "normalize.less";
:
/usr/local/lib/node_modules/punch/node_modules/less/lib/less/parser.js:418
else throw new(LessEr
Is this possible and I'm just doing something wrong?
Also, /* comment */
style comments are getting stripped, the Less documentation says that it should leave these alone.
Are you using the latest version of Punch? (You can check the version by running punch -v
. Latest version should be 0.4.16)
If you give the correct relative path for the file you're trying to import in the LESS stylesheet, it should be imported correctly.
I'll check on comment stripping issue.
Yes, using latest version, and correct relative path.
Sorry for the delay in getting back to you on this issue. But from my end I couldn't find any issues with LESS import
. Can you share how your stylesheet directory is structured?
Also, CSS style comments are not getting stripped from the generated stylesheets (unless you bundle them with the asset bundler, which does minify the styles).
I got the imports working in the end, not entirely sure what I was doing wrong in the beginning.
With regards the asset bundler, I'm guessing it uses something like Uglify... all I really need it to put a copyright notice at the top of the compressed stylesheet, would there be an easy way to achieve this or give options to the compressor?
@thelucid Using the following identifiers I believe can help preserve comments in the css:
/*! */
Example
/*!
Copyright 2013 Author
Here is the copyright
*/
I hope this helps.