Skip to content

Commit 76c5815

Browse files
committed
Tweaked layout
1 parent 7b9677f commit 76c5815

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ This will run the automated build process, start up a webserver, and open the ap
3333
3. On a Mac? You're all set. If you're on Linux or Windows, complete the steps for your OS below.
3434

3535
**On Linux:**
36-
Run this to [increase the limit](http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc) on the number of files Linux will watch. [Here's why](https://github.com/coryhouse/react-slingshot/issues/6).
36+
37+
* Run this to [increase the limit](http://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc) on the number of files Linux will watch. [Here's why](https://github.com/coryhouse/react-slingshot/issues/6).
3738
`echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p`
3839

39-
**On Windows:**
40-
1. **Install [Python 2.7](https://www.python.org/downloads/)**. Browser-sync (and various other Node modules) rely on node-gyp, which requires Python on Windows.
41-
2. **Install C++ Compiler**. [Visual Studio Express](https://www.visualstudio.com/en-US/products/visual-studio-express-vs) comes bundled with a free C++ compiler. Or, if you already have Visual Studio installed: Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop. The C++ compiler is used to compile browser-sync (and perhaps other Node modules).
40+
**On Windows:**
41+
42+
* **Install [Python 2.7](https://www.python.org/downloads/)**. Browser-sync (and various other Node modules) rely on node-gyp, which requires Python on Windows.
43+
* **Install C++ Compiler**. [Visual Studio Express](https://www.visualstudio.com/en-US/products/visual-studio-express-vs) comes bundled with a free C++ compiler. Or, if you already have Visual Studio installed: Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop. The C++ compiler is used to compile browser-sync (and perhaps other Node modules).
4244

4345
##FAQ
4446
###Why does this exist?
@@ -100,13 +102,15 @@ Webpack serves your app in memory when you run `npm start`. No physical files ar
100102
Magic! Okay, more specifically, we're handling it differently in dev (`npm start`) vs prod (`npm run build`)
101103

102104
When you run `npm start`:
105+
103106
1. The sass-loader compiles Sass into CSS
104107
2. Webpack bundles the compiled CSS into bundle.js. Sounds odd, but it works!
105108
3. bundle.js contains code that loads styles into the <head> of index.html via JavaScript. This is why you don't see a stylesheet reference in index.html. In fact, if you disable JavaScript in your browser, you'll see the styles don't load either.
106109

107110
The approach above supports hot reloading, which is great for development. However, it also create a flash of unstyled content on load because you have to wait for the JavaScript to parse and load styles before they're applied. So for the production build, we use a different approach:
108111

109112
When you run `npm run build`:
113+
110114
1. The sass-loader compiles Sass into CSS
111115
2. The [extract-text-webpack-plugin](https://github.com/webpack/extract-text-webpack-plugin) extracts the compiled Sass into styles.css
112116
3. buildHtml.js adds a reference to the stylesheet to the head of index.html.
@@ -117,7 +121,8 @@ For both of the above methods, a separate sourcemap is generated for debugging S
117121
No problem. Reference your CSS file in index.html, and add a step to the build process to copy your CSS file over to the same relative location /dist as part of the build step. But be forwarned, you lose style hot reloading with this approach.
118122

119123
### I just want an empty starter kit.
120-
This starter kit includes an example app so you can see how everything hangs together on a real app. To create an empty project, you can delete the following:
124+
This starter kit includes an example app so you can see how everything hangs together on a real app. To create an empty project, you can delete the following:
125+
121126
1. Components in src/components
122127
2. Styles in src/styles/styles.scss
123128
3. Delete files in src/businessLogic
@@ -156,7 +161,8 @@ Since browsers don't currently support ES6, we're using Babel to compile our ES6
156161

157162
Also note that no actual physical files are written to the filesystem during the dev build. **For performance, all files exist in memory when served from the webpack server.**. Physical files are only written when you run `npm run build`.
158163

159-
**Tips for debugging via sourcemaps:**
164+
**Tips for debugging via sourcemaps:**
165+
160166
1. Browsers vary in the way they allow you to view the original source. Chrome automatically shows the original source if a sourcemap is available. Safari, in contrast, will display the minified source and you'll [have to cmd+click on a given line to be taken to the original source](http://stackoverflow.com/questions/19550060/how-do-i-toggle-source-mapping-in-safari-7).
161167
2. Do **not** enable serving files from your filesystem in Chrome dev tools. If you do, Chrome (and perhaps other browsers) may not show you the latest version of your code after you make a source code change. Instead **you must close the source view tab you were using and reopen it to see the updated source code**. It appears Chrome clings to the old sourcemap until you close and reopen the source view tab. To clarify, you don't have to close the actual tab that is displaying the app, just the tab in the console that's displaying the source file that you just changed.
162168
3. If the latest source isn't displaying the console, force a refresh. Sometimes Chrome seems to hold onto a previous version of the sourcemap which will cause you to see stale code.

0 commit comments

Comments
 (0)