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

PWA-ification, via SWPrecacheWebpackPlugin + manifest.json #1728

Merged
merged 25 commits into from
May 17, 2017
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8289386
sw-precache-webpack-plugin, SW registration, manifest.json
jeffposnick Feb 11, 2017
75088ab
Documentation + a few SW tweaks.
jeffposnick Feb 12, 2017
bfed215
Added an unregister method, too, just in case.
jeffposnick Feb 16, 2017
2835105
More info for the READMEs.
jeffposnick Feb 16, 2017
2dc418b
Add minify to SWPrecacheWebpackPlugin config
goldhand Feb 17, 2017
21d14bb
Fix SWPrecacheWebpackPlugin typo
goldhand Feb 17, 2017
a681e91
Fix file references in READMEmd
ianschmitz Feb 17, 2017
a9fb906
Add instructions for testing service-worker locally
goldhand Feb 17, 2017
1cdb4cd
Merge pull request #2 from goldhand/pwa
jeffposnick Mar 3, 2017
4e3ede4
Review feedback
jeffposnick Mar 3, 2017
86d590d
Some additional PWA metadata
jeffposnick Mar 5, 2017
0640a20
Merge remote-tracking branch 'upstream/master' into pwa
jeffposnick Mar 5, 2017
cb40bd7
Use sw-precache-webpack-plugin v0.9.1 for node >=4.0.0 support
goldhand Mar 10, 2017
6aa8fe8
Merge pull request #4 from goldhand/pwa
jeffposnick Mar 27, 2017
444f0ca
Merge remote-tracking branch 'upstream/master' into pwa
jeffposnick Apr 27, 2017
6a880f8
Review feedback.
jeffposnick May 9, 2017
5ea92ae
Add manifest.json context in a comment.
jeffposnick May 9, 2017
f1b0f1d
Merge remote-tracking branch 'upstream/master' into pwa
jeffposnick May 15, 2017
074fc7e
Merge branch 'master' into pwa
gaearon May 16, 2017
804e858
Fix typo
gaearon May 16, 2017
f9b303a
Merge branch 'master' into pwa
Timer May 17, 2017
502cbdf
Downgrade to sw-precache-webpack-plugin 0.9.1
jeffposnick May 17, 2017
9ea16b7
Hide changes in README until 1.0
gaearon May 17, 2017
f8f3e20
Hide changes in User Guide until 1.0
gaearon May 17, 2017
27424ce
Hide more docs
gaearon May 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add minify to SWPrecacheWebpackPlugin config
  • Loading branch information
goldhand committed Feb 17, 2017
commit 2dc418b7b2b0eb95dabb02833f93ec1325c6778c
3 changes: 2 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ManifestPlugin = require('webpack-manifest-plugin');
var InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
var SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
var url = require('url');
var paths = require('./paths');
var getClientEnvironment = require('./env');
var SWPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');

// @remove-on-eject-begin
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
Expand Down Expand Up @@ -278,6 +278,7 @@ module.exports = {
new SWPrecacheWebpackPlugin({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A brief comment explaining the purpose of this plugin would be nice.

e.g.

// Generates the files required for a service worker

dontCacheBustUrlsMatching: /\.\w{8}\./,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe it's immediately apparent what this is doing, we should probably add a comment explaining we're trying to match any files with a hash (as generated by webpack).

This configuration is handed to the user when they eject, so anything to help them understand what's going on better. 😄

filename: 'service-worker.js',
minify: true,
navigateFallback: publicUrl + '/index.html',
staticFileGlobsIgnorePatterns: [/\.map$/, /asset-manifest\.json$/]
})
Expand Down