Skip to content

fix(@angular/cli): ignore system files in service worker #7340

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

Closed
wants to merge 2 commits into from
Closed

fix(@angular/cli): ignore system files in service worker #7340

wants to merge 2 commits into from

Conversation

cyrilletuzi
Copy link
Contributor

Related to angular/mobile-toolkit#180

When copying the assets, the CLI includes system files (e.g. .DS_Store and Thumbs.db). As a consequence, they are included in the service worker manifest as files to cache. But such file may (and should) not be deployed to the server, then a file will be missing, then the service worker installation will fail and so all the offline feature won't work.

This PR makes the CLI ensure the service worker will ignore these system files.

Related to angular/mobile-toolkit#180

When copying the assets, the CLI includes system files (e.g. .DS_Store and Thumbs.db). As a consequence, they are included in the service worker manifest as files to cache. But such file may (and should) not be deployed to the server, then a file will be missing, then the service worker installation will fail and so all the offline feature won't work.

This PR makes the CLI ensure the service worker will ignore these system files.
@intellix
Copy link
Contributor

intellix commented Aug 11, 2017

Maybe ignore all files that begin with a dot? Not sure what else there would be but I don't think any of them should be included ever :)

@cyrilletuzi
Copy link
Contributor Author

cyrilletuzi commented Aug 11, 2017

I'm not sure the angular/service-worker API permits to remove patterns from the ignore field, so it may be not a good idea to include too much things, as special user cases could be blocked.

And as we are in the CLI, it's the CLI itself who chooses which files will be generated, so there should be no risk for other files.

@filipesilva
Copy link
Contributor

@alxhub can you have a look please?

@cyrilletuzi
Copy link
Contributor Author

Will this be part of the finalization of service-worker in Angular 5 and CLI complete automation of PWA ?

@playground
Copy link

Can we also have the capability to exclude certain files from the build?
For example:

"static.ignore": [
"/assets/",
"**/
.map"
]

@cyrilletuzi
Copy link
Contributor Author

Closed in favor of angular/devkit#263

@cyrilletuzi cyrilletuzi closed this Nov 7, 2017
@cyrilletuzi cyrilletuzi deleted the patch-6 branch November 7, 2017 19:52
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants