Skip to content

Commit

Permalink
Merge pull request #1 from facebookincubator/master
Browse files Browse the repository at this point in the history
sync with origin
  • Loading branch information
zangrafx committed May 26, 2017
2 parents 90f9c6b + fbaeff2 commit 8ce6560
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/react-dev-utils/FileSizeReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var stripAnsi = require('strip-ansi');
var gzipSize = require('gzip-size').sync;

// Prints a detailed summary of build files.
function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
function printFileSizesAfterBuild(webpackStats, previousSizeMap, buildFolder) {
var root = previousSizeMap.root;
var sizes = previousSizeMap.sizes;
var assets = webpackStats
Expand All @@ -30,7 +30,7 @@ function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
var previousSize = sizes[removeFileNameHash(root, asset.name)];
var difference = getDifferenceLabel(size, previousSize);
return {
folder: path.join('build', path.dirname(asset.name)),
folder: path.join(path.basename(buildFolder), path.dirname(asset.name)),
name: path.basename(asset.name),
size: size,
sizeLabel: filesize(size) + (difference ? ' (' + difference + ')' : ''),
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ measureFileSizesBeforeBuild(paths.appBuild)
}

console.log('File sizes after gzip:\n');
printFileSizesAfterBuild(stats, previousFileSizes);
printFileSizesAfterBuild(stats, previousFileSizes, paths.appBuild);
console.log();

const appPackage = require(paths.appPackageJson);
Expand Down
22 changes: 9 additions & 13 deletions packages/react-scripts/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ If your production web server does not support HTTPS, then the service worker
registration will fail, but the rest of your web app will remain functional.

1. Service workers are [not currently supported](https://jakearchibald.github.io/isserviceworkerready/)
in all web browsers. Service worker registration [won't be attempted](src/service-worker-registration.js)
in all web browsers. Service worker registration [won't be attempted](src/registerServiceWorker.js)
on browsers that lack support.

1. The service worker is only enabled in the [production environment](#deployment),
Expand All @@ -1419,7 +1419,7 @@ instructions for one way to test your production build locally and the [deployme
instructions for using other methods. *Be sure to always use an
incognito window to avoid complications with your browser cache.*

1. If possible,configure your production environment to serve the generated
1. If possible, configure your production environment to serve the generated
`service-worker.js` [with HTTP caching disabled](http://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours).
If that's not possible—[GitHub Pages](#github-pages), for instance, does not
allow you to change the default 10 minute HTTP cache lifetime—then be aware
Expand All @@ -1437,7 +1437,7 @@ app works offline!" message) and also let them know when the service worker has
fetched the latest updates that will be available the next time they load the
page (showing a "New content is available; please refresh." message). Showing
this messages is currently left as an exercise to the developer, but as a
starting point, you can make use of the logic included in [`src/service-worker-registration.js`](src/service-worker-registration.js), which
starting point, you can make use of the logic included in [`src/registerServiceWorker.js`](src/registerServiceWorker.js), which
demonstrates which service worker lifecycle events to listen for to detect each
scenario, and which as a default, just logs appropriate messages to the
JavaScript console.
Expand Down Expand Up @@ -1774,27 +1774,23 @@ When you build the project, Create React App will place the `public` folder cont
### Now
[now](https://zeit.co/now) offers a zero-configuration single-command deployment.
[now](https://zeit.co/now) offers a zero-configuration single-command deployment. You can use `now` to deploy your app for free.
1. Install the `now` command-line tool either via the recommended [desktop tool](https://zeit.co/download) or via node with `npm install -g now`.
2. Install `serve` by running `npm install --save serve`.
2. Build your app by running `npm run build`.
3. Add this line to `scripts` in `package.json`:
3. Move into the build directory by running `cd build`.
```
"now-start": "serve -s build/",
```
4. Run `now` from your project directory. You will see a **now.sh** URL in your output like this:
4. Run `now --name your-project-name` from within the build directory. You will see a **now.sh** URL in your output like this:
```
> Ready! https://your-project-dirname-tpspyhtdtk.now.sh (copied to clipboard)
> Ready! https://your-project-name-tpspyhtdtk.now.sh (copied to clipboard)
```
Paste that URL into your browser when the build is complete, and you will see your deployed app.
Details are available in [this article.](https://zeit.co/blog/now-static)
Details are available in [this article.](https://zeit.co/blog/unlimited-static)
### S3 and CloudFront
Expand Down

0 comments on commit 8ce6560

Please sign in to comment.