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

Per view js / less compilation #34

Closed
kungfoolabs opened this issue Feb 2, 2015 · 4 comments
Closed

Per view js / less compilation #34

kungfoolabs opened this issue Feb 2, 2015 · 4 comments

Comments

@kungfoolabs
Copy link

Great project and awesome for getting started. One thing that is that currently missing the per view js and css compilation. Looking at drywall, this was something that was present and made it easy to have backbone, for example. integrated only on some of the pages. Not sure the recommended way, but I am looking into using browserify.

@dstroot
Copy link
Owner

dstroot commented Feb 2, 2015

Actually the project does have per page less/css. If you create a page specific less file in /less such as `colors-api.less' it will be compiled and minified separately. Then include the page specific css in the jade template like so:

extends ../layouts/layout

block head
  title #{application} · Colors

block styles
  link(rel='stylesheet', href='/css/page-colors.min.css')

...

I think it also makes sense to have per view specific js but since just about everything is done via libraries anyway I did not build it out - I just reference the .js file via a script tag.

@kungfoolabs
Copy link
Author

Thanks Dan. That makes sense. I am trying to get the client side js to conform to the CommonJS standard by using browserify. Will definitely send a change request if/when I get it figured out.

@dstroot
Copy link
Owner

dstroot commented Feb 3, 2015

Great - definitely send a PR.

Side note - why Browserify instead of Webpack? ​

On Sun, Feb 1, 2015 at 11:19 PM, kungfoolabs notifications@github.com
wrote:

Thanks Dan. That makes sense. I am trying to get the client side js to
conform to the CommonJS standard by using browserify. Will definitely send
a change request if/when I get it figured out.


Reply to this email directly or view it on GitHub
#34 (comment).

@kungfoolabs
Copy link
Author

LOL. Because i didn't know about Webpack. Will check it out.

@dstroot dstroot closed this as completed Feb 15, 2015
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

2 participants