- Use webpack to automate development & production builds
- Watch changes you make update instantly with a local development server & live reload
- Optimize images with Imagemin
- Generate truely responsive images
- Pre-packaged with the Foundation framework or load your own!
- Pre-packaged with React & Babel
- Mark & quickly find TODOs, FIXMEs & more in console or in a generated report
- Easily define supported browsers with browserlist
- Code confidently with JS, Sass & CSS linters… plus get notified when unsupported browser properties are used!
- Automatically add browser prefixes based on the supported browsers
- Minify your CSS even more by automatically removing unused properties with PurifyCSS
- Supports CSS Modules for locally scoped class names
- Miss your Compass mixins? No worries with compass-mixins!
- Set a performance budget & get notified when your build exceeds it
- Build HTML templates with Handlebars
- Generate statistc reports that can analyze the build output
Download the script here and include it (unless you are packaging scripts somehow else).
Navigate to the frontpack directory in Terminal and run the following commands:
$ npm installTo install dependencies
$ npm startBuild & watch files
The following node commands are available:
$ npm start(or
npm start) Starts the project in the development mode. Surf to
localhost:8080in your browser to see it running.
$ npm run buildGenerates a production build below
build. You can open the generated index.html through the browser to examine the result.
$ npm run lint:jsExecutes ESLint against the code. ESLint is able to catch smaller issues. The default setup lints even during development so you rarely need to execute this command yourself.
$ npm run statsGenerates statistics (
stats.json) about the project. You can analyze the build output further.
$ npm run styleguideGenerates a style guide. The default setup generates one even during development so you rarely need to execute this command yourself.
$ npm run deployDeploys the project to GitHub pages.
Removing Unused CSS
The default setup removes unused CSS during production builds using PurityCSS by scanning all files in the
purifyOptions.paths setting in the webpack configuration file. Unfortunately, due to how webpack handles files in memory, PurityCSS is unable to scan URLs. To solve this, Frontpack allows you to run uncss outside of webpack by running the following:
$npm run --silent uncss [url(s)] > dist/css/[filename].css
[url(s)] with the URL(s) uncss should scan and
[filename] with the name of the output file.
(ex. npm run --silent uncss https://bmarshall511.github.io/frontpack/ > dist/css/global.bundle.css).
IMPORTANT: For production builds using uncss,
npm run build should be run first, then the uncss command above to ensure the file stays minimized. Also, be sure not to leave out the
--silent argument or the node command will be added to the top of the outputted file. To change uncss options, use the
Check out the Contributing Guidelines.
For vulnerability reports, send an e-mail to
me at benmarshall dot me.
v1.0.2 (Oct. 12, 2017)
- Fix for bugs url in node package.
- Fix for false positive errors when using the rem-calc (https://github.com/bmarshall511/frontpack/issues/3)
- Update to the output path for the webpack loadFonts part (https://github.com/bmarshall511/frontpack/issues/7)
- Update to stylelint's output warnings (https://github.com/bmarshall511/frontpack/issues/4)
- Update to the selector-class-pattern to comply with BEM (https://github.com/bmarshall511/frontpack/issues/2)
- Added gh-pages
- Added a custom variables sass file (https://github.com/bmarshall511/frontpack/issues/6)
- Added uncss as an option to remove unused CSS
v1.0.1 (Oct. 10, 2017)
- First public release.