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

Minification is stripping the basic IIFE wrapper from the cached templates #161

Closed
dmellstrom opened this issue Oct 17, 2018 · 4 comments
Closed

Comments

@dmellstrom
Copy link
Contributor

My issue is with the moduleSystem option, value 'IIFE'.

When minifying a build containing concatenated cached templates provided by this plugin, using UglifyJS, the functional wrapper is removed from the prepared templates.

dmellstrom added a commit to dmellstrom/gulp-angular-templatecache that referenced this issue Oct 17, 2018
@simonua
Copy link
Collaborator

simonua commented Oct 17, 2018

While I principally tend to agree with this change, I'm wondering whether introducing strict mode in the function context might break sloppy code contained in the IIFE.

@simonua
Copy link
Collaborator

simonua commented Oct 17, 2018

We currently don't have any tests for IIFE. IMHO, this would necessitate adding some coverage.

@dmellstrom
Copy link
Contributor Author

In theory, there won't be any sloppy or even non-static code contained in the IIFE, as it will just contain the template strings plus the surrounding Angular boilerplate added by this plugin.
However, I concur that test coverage for IIFE is a good idea. I will add a relevant commit to my PR.

@simonua
Copy link
Collaborator

simonua commented Oct 24, 2018

@dmellstrom, thanks very much for adding the test.

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