Skip to content

Commit 78cf568

Browse files
author
chee
committed
have the service-worker precache files in public/
1 parent a51be95 commit 78cf568

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-scripts/config/webpack.config.prod.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ module.exports = {
343343
navigateFallbackWhitelist: [/^(?!\/__).*/],
344344
// Don't precache sourcemaps (they're large) and build asset manifest:
345345
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/],
346+
// Precache files in public/, and allow them to be accessed directly
347+
staticFileGlobs: ['./public/**/*'],
348+
mergeStaticsConfig: true,
349+
stripPrefix: './public',
346350
}),
347351
// Moment.js is an extremely popular library that bundles large locale files
348352
// by default due to how Webpack interprets its code. This is a practical

0 commit comments

Comments
 (0)