Unable to omit assets in build #87

Closed
gzip opened this Issue Jun 7, 2013 · 3 comments

3 participants

@gzip

The assets folder is still copied over even though the config contains assets: false.

{
    "name": "foobar",
    "builds": {
        "bar": {
            "prependfiles": ["foo.js"],
            "jsfiles": [
                "bar.js"
            ],
            "assets": false
        }
    }
}
@caridy caridy was assigned Jun 8, 2013
@gzip

We're deploying several large assets multiple times due to this issue. Any chance this will be addressed soon?

@davglass
YUI Library member

My gut says that it's likely this block:

https://github.com/yui/shifter/blob/master/lib/builder.js#L162-L164

if (!mod.skinnable && !(mod.config && mod.config.skinnable)) {
    mod.assets = !hasSkin;
}

Probably should be this:

if (!mod.skinnable && !(mod.config && mod.config.skinnable) && mod.assets !== false) {
    mod.assets = !hasSkin;
}

If mod.assets is false then it probably shouldn't auto set this based on not having a skin. If memory serves, if there is no skinnable attribute on a module then it will set mod.assets to true. Adding the mod.assets !== false will cause this logic to be skipped if assets: false is in the build.json file.

@evocateur evocateur added a commit to zillow/shifter that referenced this issue Jul 17, 2013
@evocateur evocateur Omit assets in non-skinnable builds when mod.assets === false
When a module's build config includes the "assets" property set to `false`,
we should skip copying any existing assets folder for that build target.

However, if that module's meta.json includes the "skinnable" property set
to true, the assets directory will still be copied, as it is required by
the skinning pattern.

Fixes #87
420aa91
@davglass
YUI Library member

I guess I was right :) Thanks @evocateur

@caridy caridy closed this in #92 Jul 19, 2013
@dmi3y dmi3y added a commit to dmi3y/shifter that referenced this issue Aug 28, 2013
@evocateur evocateur Omit assets in non-skinnable builds when mod.assets === false
When a module's build config includes the "assets" property set to `false`,
we should skip copying any existing assets folder for that build target.

However, if that module's meta.json includes the "skinnable" property set
to true, the assets directory will still be copied, as it is required by
the skinning pattern.

Fixes #87
69da324
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment