laktek / punch

A fun and easy way to build modern websites
http://laktek.github.com/punch
MIT License
1.17k stars 107 forks source link

Less parser.js error: 385 #36

Closed c11z closed 11 years ago

c11z commented 11 years ago

I recently moved the twitter bootstrap less files into a folder called boostrap in my css folder in templates. I import the bootstrap.less file into a file I call custom.less and use punch's bundling to minify into all.css as per your example.

$ punch s

is successful but

$ punch g
Generating site...

/usr/local/lib/node_modules/punch/node_modules/less/lib/less/parser.js:385
                        throw new(LessError)(e, env);
                              ^
[object Object]

fails with the above error code. If I run:

$ lessc custom.less

I receive no errors, and if I compile my code with lessc into a css file and remove all my less files from my project then punch g works.

You can look into the project here

Thanks

laktek commented 11 years ago

Hi Cory,

Problem here is Punch generator tries to process each of the LESS files available in template/css/bootstrap. However, since they are not self-contained and misses dependencies they fail.

You can instruct Punch to leave out the files in a certain path when generating the site. For this, you need to add the following option to you config.json file.

"generator": { "skip_paths": [ "css/bootstrap" ] }

Then try generating the site again and it should work.

BTW, nice use of Punch :) Feel free to add it to the list of sites built with Punch, when you complete the project.

c11z commented 11 years ago

Thanks that solved the problem. I think punch is just great. I have a jekyll blog and I have looked into a lot of other static site generators but punch is the most intuitive I have used yet. When I get the site live I'll add it to the wiki page.