Skip to content

Commit 8ce6560

Browse files
authored
Merge pull request #1 from facebookincubator/master
sync with origin
2 parents 90f9c6b + fbaeff2 commit 8ce6560

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

packages/react-dev-utils/FileSizeReporter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var stripAnsi = require('strip-ansi');
1818
var gzipSize = require('gzip-size').sync;
1919

2020
// Prints a detailed summary of build files.
21-
function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
21+
function printFileSizesAfterBuild(webpackStats, previousSizeMap, buildFolder) {
2222
var root = previousSizeMap.root;
2323
var sizes = previousSizeMap.sizes;
2424
var assets = webpackStats
@@ -30,7 +30,7 @@ function printFileSizesAfterBuild(webpackStats, previousSizeMap) {
3030
var previousSize = sizes[removeFileNameHash(root, asset.name)];
3131
var difference = getDifferenceLabel(size, previousSize);
3232
return {
33-
folder: path.join('build', path.dirname(asset.name)),
33+
folder: path.join(path.basename(buildFolder), path.dirname(asset.name)),
3434
name: path.basename(asset.name),
3535
size: size,
3636
sizeLabel: filesize(size) + (difference ? ' (' + difference + ')' : ''),

packages/react-scripts/scripts/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ measureFileSizesBeforeBuild(paths.appBuild)
7575
}
7676

7777
console.log('File sizes after gzip:\n');
78-
printFileSizesAfterBuild(stats, previousFileSizes);
78+
printFileSizesAfterBuild(stats, previousFileSizes, paths.appBuild);
7979
console.log();
8080

8181
const appPackage = require(paths.appPackageJson);

packages/react-scripts/template/README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,7 +1403,7 @@ If your production web server does not support HTTPS, then the service worker
14031403
registration will fail, but the rest of your web app will remain functional.
14041404

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

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

1422-
1. If possible,configure your production environment to serve the generated
1422+
1. If possible, configure your production environment to serve the generated
14231423
`service-worker.js` [with HTTP caching disabled](http://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours).
14241424
If that's not possible—[GitHub Pages](#github-pages), for instance, does not
14251425
allow you to change the default 10 minute HTTP cache lifetime—then be aware
@@ -1437,7 +1437,7 @@ app works offline!" message) and also let them know when the service worker has
14371437
fetched the latest updates that will be available the next time they load the
14381438
page (showing a "New content is available; please refresh." message). Showing
14391439
this messages is currently left as an exercise to the developer, but as a
1440-
starting point, you can make use of the logic included in [`src/service-worker-registration.js`](src/service-worker-registration.js), which
1440+
starting point, you can make use of the logic included in [`src/registerServiceWorker.js`](src/registerServiceWorker.js), which
14411441
demonstrates which service worker lifecycle events to listen for to detect each
14421442
scenario, and which as a default, just logs appropriate messages to the
14431443
JavaScript console.
@@ -1774,27 +1774,23 @@ When you build the project, Create React App will place the `public` folder cont
17741774
17751775
### Now
17761776
1777-
[now](https://zeit.co/now) offers a zero-configuration single-command deployment.
1777+
[now](https://zeit.co/now) offers a zero-configuration single-command deployment. You can use `now` to deploy your app for free.
17781778
17791779
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`.
17801780
1781-
2. Install `serve` by running `npm install --save serve`.
1781+
2. Build your app by running `npm run build`.
17821782
1783-
3. Add this line to `scripts` in `package.json`:
1783+
3. Move into the build directory by running `cd build`.
17841784
1785-
```
1786-
"now-start": "serve -s build/",
1787-
```
1788-
1789-
4. Run `now` from your project directory. You will see a **now.sh** URL in your output like this:
1785+
4. Run `now --name your-project-name` from within the build directory. You will see a **now.sh** URL in your output like this:
17901786
17911787
```
1792-
> Ready! https://your-project-dirname-tpspyhtdtk.now.sh (copied to clipboard)
1788+
> Ready! https://your-project-name-tpspyhtdtk.now.sh (copied to clipboard)
17931789
```
17941790
17951791
Paste that URL into your browser when the build is complete, and you will see your deployed app.
17961792
1797-
Details are available in [this article.](https://zeit.co/blog/now-static)
1793+
Details are available in [this article.](https://zeit.co/blog/unlimited-static)
17981794
17991795
### S3 and CloudFront
18001796

0 commit comments

Comments
 (0)