This is a bootstrap project to help you get started quickly with a front-end project using React, Jest, Browserify, and gulp.
npm install
# Run tests
npm test
# Build output
npm run build
# Build output and then start local server at http://localhost
npm run dev
Third-party dependencies are included via a CDN instead of with Bower. This is done by design to utilize the caching of common libraries in end-users' browsers. In order to include a new dependency, follow the steps below:
- Include a script reference in the
__web/index.html
to their hosted CDN URL. - Include a reference to the library in
package.json
underbrowserify-shim
. As an example: if you are usingrequire('jquery')
in your application, then you must tell browserify where'jquery'
comes from. The shim inpackage.json
gives you the ability to associate a name,'jquery'
with its reference,$
found in the global namespace. - [Optional]: By default Jest mocks all dependencies unless otherwise specified. If you wish Jest to not mock a dependency that is a third-party dependnecy, then you must install the dependency as a npm package. The reason why is so that when Jest encounters a
require('underscore')
, for example, and underscore is not mocked, it will look to require it from your npm modules.