##Clone submodules
The --recursive
flag should do all the work if you used it while cloning this
repo. If not, try this:
git submodule update --init --recursive
That will clone all the necessary submodules.
If things don't go the way you were expecting, check if you've done this already:
git submodule update --recursive
That will update the submodules to make sure you're using the most recent HEAD
##Initial Machine Setup
- Install Node 4.0.0 or greater - (5.0 or greater is recommended for optimal build performance). Need to run multiple versions of Node? Use nvm.
- Install Git.
- Install React developer tools and Redux Dev Tools in Chrome. (Optional, but helpful. The latter offers time-travel debugging.)
- run
npm install
to install all the dependences.
##Usage
Webpack serves your app in memory when you run npm start
. No physical files are written. However, the web root is /src, so you can reference files under /src in index.html. When the app is built using npm run build
, physical files are written to /dist and the app is served from /dist.
When you run npm start
:
- The sass-loader compiles Sass into CSS
- Webpack bundles the compiled CSS into bundle.js. Sounds odd, but it works!
- 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.
When you run npm run build
:
- The sass-loader compiles Sass into CSS
- The extract-text-webpack-plugin extracts the compiled Sass into styles.css
- buildHtml.js adds a reference to the stylesheet to the head of index.html.
On Windows, you need to install extra dependencies for browser-sync to build and install successfully. Follow the getting started steps above to assure you have the necessary dependencies on your machine.
##Author Information
This role is provided by the Tinkerware project under a The MIT Licence.
Feel free to open a Pull Request if you see anything that you think could be improved.