Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Exclude Component-preload.js from SRC #21

Closed
agraebe opened this issue Jan 12, 2016 · 3 comments
Closed

Exclude Component-preload.js from SRC #21

agraebe opened this issue Jan 12, 2016 · 3 comments
Labels
approved bug Something isn't working fixed

Comments

@agraebe
Copy link

agraebe commented Jan 12, 2016

It looks like the openui5_preload task by deafuly includes "Component-preload.js" files. Hence, with multiple executions fo the same task, the previous preload will always be appended and the file become bigger and bigger.

Is there a way to specifically exclude existing preload files from the SRC? I think this should also be a default

@matz3
Copy link
Contributor

matz3 commented Jan 13, 2016

That's right and I already thought about excluding it by default. As there should never be a case where it is intended to include the preload into the same file again I think it is save to change that.

In the meantime you can define an exclude in your configuration:
(I just saw that the readme example is not correct as excludes need to start with an exclamation mark. I will fix that)

webapp
  - Component.js ("my.app.Component")
Gruntfile.js
openui5_preload: {
    component: {
        options: {
            resources: {
                cwd: "webapp",
                prefix: "my/app"
            },
            dest: "webapp"
        },
        components: {
            "my/app": {
                // note that defining the "src" property overwrites all default includes/excludes
                src: [
                    "my/app/**", // include all available resources (this is the default)
                    "!my/app/Component-preload.js" // exclude the Component-preload.js
                ]
            }
        }
    }
}

@matz3 matz3 self-assigned this Jan 13, 2016
@agraebe
Copy link
Author

agraebe commented Jan 13, 2016

Sweet, I'll check it out as well. In the meantime, I have updated the readme in this PR: #22

@matz3
Copy link
Contributor

matz3 commented Jan 18, 2016

Thanks 👍 I've added some comments.

matz3 added a commit that referenced this issue Feb 2, 2016
This change will always add an exclude to prevent adding a
previously created preload file into the same preload.
As there should be no use case to do that this is enabled
by default without an option to disabled it.

Other preload files (e.g. from sub-components) should be
possible to include.

Fixes #21
@matz3 matz3 closed this as completed in #25 Apr 25, 2016
@matz3 matz3 removed their assignment Apr 27, 2016
@matz3 matz3 added bug Something isn't working approved fixed labels Apr 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants