Further bundling #28

Closed
collino opened this Issue Sep 28, 2012 · 7 comments

Comments

Projects
None yet
2 participants
Contributor

collino commented Sep 28, 2012

Hi Lakshan,

I'm working on a project where others are involved and it's making sense to break CSS modules out into their own individual files and then combine them all into a master modules.css, which in turn is combined with all the other types of CSS.

Anyway, a few lines of code are worth a thousand words:

"bundles": {
    "/css/module.css": [
        "/css/modules/*.css"
    ],
    "/css/all.css": [
        "/css/base.css",
        "/css/layout.css",
        "/css/module.css",
        "/css/theme.css",
        "/css/state.css"
    ]
}

Firstly, as more of a designer than a developer perhaps this is silly. Second, if it's not silly is it possible? I tried a few different versions of the above with the * to no avail.

Thanks!

Owner

laktek commented Sep 28, 2012

This feature is currently not there, but doable. Instead of picking the files directly from the templates, we must first check if the given path is a bundle path and if so pick it as a bundle.

I'll try to find some time to add this feature (if someone else is willing to give it a try, change should happen in this line).

laktek closed this in 4e3db7d Sep 30, 2012

Owner

laktek commented Sep 30, 2012

Hi Collin,

Check out the latest Punch release (v 0.4.11). It gives you the option to define nested bundles (and wildcard paths) as you specified.

Let me know if run into any issues.

Owner

laktek commented Sep 30, 2012

Updated the guide with examples of the new feature - https://github.com/laktek/punch/wiki/Asset-Bundles

Contributor

collino commented Oct 1, 2012

Awesome! Thanks Lakshan, I'll check it out this week

Contributor

collino commented Oct 4, 2012

Hi Lakshan,

I updated Punch (via npm update) and I'm unable to get this to work. Here's a real example:

"bundles": {
    "/css/frameworks.css": [
        "/css/frameworks/normalize.css"
        "/css/frameworks/foundation.css"
    ],
    "/css/module.css": [
        "/css/modules/*.css"
    ],
    "/css/all.css": [
        "/css/frameworks.css",
        "/css/base.css",
        "/css/layout.css",
        "/css/module.css",
        "/css/theme.css",
        "/css/state.css"
    ]
}

In the above, frameworks.css and module.css are successfully created by Punch. frameworks.css is successfully bundled with compacted versions of normalize.css and foundation.css.

module.css on the other hand is empty, and all.css does not have frameworks.css nor module.css bundled into it.

If I run punch v I get Punch version 0.4.3

Anything else I can give you to help?

Owner

laktek commented Oct 4, 2012

@collino It seems the version is not right. You will need a version that equal or greater than 0.4.11. Instead of npm update, Can you try installing Punch again with npm install -g punch?

Contributor

collino commented Oct 4, 2012

Oh derp...

npm install -g punch did the trick.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment