You can use this repo one of two ways.
- Clone the repo directly.
- Change package.json to reflect new project you are working on.
- Change git from pointing to this directory to point at your new project repo.
- Use generate-react-boilerplate generator to create a new react project that uses a new package.json and is
not linked to this git repo.
generate-react-boilerplate
can be found here. Just follow the directions in theREADME.md
.
-
If you cloned this repo from the generator tool generate-react-boilerplate you already have all the dependencies installed. If you cloned this repo directly you will have do an
npm install
in the root of your project. -
After the dependencies are installed you can run one of twelve different scripts that run tests, lint, create a build, or run webpack-dev-server for development.
npm run [local | dev | stage | prod]:server
This runs webpack-dev-server
and serves the build on port 3000. Any changes to the source code will cause a hot-reload
npm run test
This uses mocha to run any files under the /src
directory that has a name that end with **.test.js
(example: NewComponent.test.js)
For linting .js files run
npm run lint
To auto-fix most errors run
npm run lint:fix
To lint sass files run
npm run lint:sass
npm run [local | dev | stage | prod]:build
Running for prod
will minify and uglify the build files. It will also remove the source maps. All needed files will be saved
to the /dist
directory