Skip to content
 
 

Repository files navigation

Sails + React + Webpack boilerplate

A boilerplate for Sails apps with a React frontend.

Includes


Clone

git clone https://github.com/markmur/sails-react-webpack.git
cd sails-react-webpack
npm install

Run (development)

There are multiple ways to run the project in development as sails and webpack-dev-server run independently. The easiest way is to use Foreman (npm install -g foreman) and run:

nf start

This will start all processes listed in the Procfile.

To view your app, go to http://localhost:3000 in your browser.


Run (Production)

Wepack builds the bundle files on postinstall and sails is lifted the same way it's always lifted in production:

sails lift --prod

You can also manually run webpack with npm run dist.


Frontend tests

You need karma-cli installed globally

$ npm install -g karma-cli

To watch the files and test files

$ karma start

To run once

$ npm run test:ui

You can play around with the Karma configuration at karma.conf.js.

Unit Tests

Runs mocha_istanbul with Grunt.

To run

$ npm test

behind the npm scenes it simply runs

$ grunt test

Pre-Push

Tests run with pre-push every time you try to push any code.

Note that Sails cannot be lifted for the Unit Tests to run successfully.

About

A Sails, React & Webpack boilerplate

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages