Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 1.21 KB

README.md

File metadata and controls

28 lines (20 loc) · 1.21 KB

Usage examples

These directories illustrate how to use the Design System uswds npm package with different tools:

  1. Compiling CSS with node-sass
  2. Bundling JavaScript with browserify and webpack
  3. Automating CSS and JS generation with the Grunt and Gulp task runners

For each of these examples, you'll need to first install Node.js version 4 or greater. Node comes with npm, the Node Package Manager, a dependency manager that uses the package.json in each directory to:

  • determine what to download and install when you run npm install
  • run repeatable tasks, or scripts
  • publish your work to the npm registry

General

If you require('uswds') in your bundled JS, you will get the minified ES5 browser bundle. If you're handling ES5 conversion already or using a tool that does it automatically, you can work around this in two ways:

  1. Import the specific entry point with require('uswds/src/js/start').
  2. Configure your bundler to read the entry point from the jsnext:main field instead of main.