This boiler is currently aligned with Facebook's Create React App and from now in these docs I will refer to it as CRA.
I am using ES6 and ES6 class syntax for components as per 2017 react community conventions
npm run start // dev server localhost:3000
npm run build // compile src files to build folder
npm install -g serve // install serve
serve -s build // serve the build folder to localhost:5000
Please note that in order to allow absolute paths as well as relative paths issue #741 the line of code NODE_PATH=./src
has been added to package.json and this will work for Mac and Linux. For Windows users an &&
may need to be added, refer to CRA docs. Hoping a better solution comes with future iterations of CRA.
Alteration to package.json so currently we are using "homepage" : "." see CRA docs
The only time I start anything (var, css class, css ID) with a capital is for an ES6 React component and this is per the CRA convention. Everything else including filenames I start with lowercase.
- window.appStatus
- window.dc
- window.stores
- window._ (underscore/lodash)
- dispatcher
Pulling in vendor libraries for client side runtime that are packaged through npm. For example we want the use of Underscore _ or window._ we will import the npm package lodash only once in the app and assign it to the window level object
Pulling in vendor libraries that are downloaded as .js or .min.js and stored in the public folder For examples of how to do this I am linking to testvendor.js and bootstrap.min.css
Note the way CRA does things for linked images is that images are stored in /src and they are 'imported' just like the way css assets are