Build Commands
Fast Build
For rapid development iteration without tests or linting:- Bundles JavaScript with Browserify
- Processes JSX with Babel
- Concatenates CSS files
- Generates
index.htmlfrom template - Skips tests and linting for faster builds
Production Build
For a complete build with all quality checks:- Runs all
fastBuildsteps - Executes the full test suite
- Runs JSHint linting
- Minifies JavaScript with Terser
- Minifies CSS
- Hashes filenames for cache busting
- Minifies HTML output
Watch Mode
Automatically rebuild when files change:Development Server
Start the Vite development server with hot module replacement:- Fast startup time
- Hot module replacement (HMR)
- Instant updates without full page reload
- Better error messages in the browser
The Vite dev server is recommended for rapid development. For testing the full build output, use
yarn gulp fastBuild and open index.html directly.Testing
Run All Tests
Execute the complete Jasmine test suite:Test Coverage
Run tests with NYC coverage reporting:Run Specific Tests
Execute a single test file:git.spec.js with any test file in the __tests__/ directory.
Linting
JavaScript Linting
Run JSHint on all source files:String Validation
Validate internationalization strings:Viewing Your Changes
Open in browser
Open the generated Or simply drag the file into your browser window.
index.html file directly in your browser:Build Output
After building, you’ll find:index.html: Generated HTML file in the root directorybuild/: Directory containing bundled JavaScript and CSS- JavaScript bundles (hashed filenames in production)
- CSS stylesheets (concatenated and minified)
Common Workflows
Making a Quick Change
Preparing a Pull Request
Debugging Build Issues
Build fails with module errors
Build fails with module errors
Try removing and reinstalling dependencies:
Tests are failing
Tests are failing
Run tests in isolation to identify the problem:Check the test output for specific failures.
Linting errors
Linting errors
Review JSHint output and fix code style issues:Common issues include missing semicolons, unused variables, and incorrect indentation.
Build Process Details
The build system performs these steps:- JavaScript bundling: Browserify bundles all modules starting from entry points
- JSX transformation: Babel transforms React JSX syntax to JavaScript
- CSS processing: Concatenates all CSS files from
src/style/ - Template processing: Injects bundled assets into
template.index.html - Minification (production only): Terser minifies JavaScript, clean-css minifies CSS
- Hashing (production only): Adds content hashes to filenames for cache busting
- Testing: Runs Jasmine test suite
- Linting: Validates code with JSHint
yarn gulp build.