From 9624507abc3036f6a92b784ff0c08c8015a8baf8 Mon Sep 17 00:00:00 2001 From: Cyrille Tuzi Date: Sun, 19 Nov 2017 16:24:54 +0100 Subject: [PATCH] fix(@angular/cli): ignore system files in assets Replaces angular/devkit#263 When copying the assets during build, the CLI must not include system files (e.g. `.DS_Store` and `Thumbs.db`). It is very important for service worker to work : if presents, these files will be included in the service worker manifest as files to cache. But such files may (and should) not be deployed to the server. Then on the client, files will be missing, then the service worker installation will fail and so all the offline feature won't work. --- packages/@angular/cli/models/webpack-configs/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@angular/cli/models/webpack-configs/common.ts b/packages/@angular/cli/models/webpack-configs/common.ts index 8c2111b25516..ce6fc5795952 100644 --- a/packages/@angular/cli/models/webpack-configs/common.ts +++ b/packages/@angular/cli/models/webpack-configs/common.ts @@ -121,7 +121,7 @@ export function getCommonConfig(wco: WebpackConfigOptions) { } }; }); - const copyWebpackPluginOptions = { ignore: ['.gitkeep'] }; + const copyWebpackPluginOptions = { ignore: ['.gitkeep', '**/.DS_Store', '**/Thumbs.db'] }; const copyWebpackPluginInstance = new CopyWebpackPlugin(copyWebpackPluginPatterns, copyWebpackPluginOptions);