Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Unable to omit assets in build #87

Closed
gzip opened this Issue · 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
@gzip

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

@davglass
Owner

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 referenced this issue from a commit in zillow/shifter
@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
Owner

I guess I was right :) Thanks @evocateur

@caridy caridy closed this in #92
@dmi3y dmi3y referenced this issue from a commit in dmi3y/shifter
@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
Something went wrong with that request. Please try again.