Get started
Frontwerk requires NodeJS and either npm or yarn.
Compatibility note: Frontwerk requires NodeJS v8.4 or greater because it uses ES6 features that are not available in previous versions of node.
Frontwerk assumes basic knowledge of the underlying tools used. These include ESLint, Jest, Prettier, Stylelint, Babel, Webpack and Rollup. Please note however, this is not required unless you want to extend the default configurations provided by Frontwerk.
Install Frontwerk
This module is distributed via npm and should be installed as one of your project’s devDependencies
via either npm:
npm install frontwerk --save-dev
or with yarn:
yarn add frontwerk
Use Frontwerk
Frontwerk is a CLI and exposes a bin called frontwerk
. You can run
frontwerk
with no arguments to show a list of available commands.
You can then simply ammend your package.json
’s scripts
property to include the scripts you want to use:
{
"scripts": {
"lint:js": "frontwerk lint",
"lint:css": "frontwerk stylelint",
"format": "frontwerk format",
"test": "frontwerk test --no-watch",
"test:watch": "frontwerk test",
"build": "frontwerk build"
}
}
Overriding the configuration
Although it works out of the box, Frontwerk allows you to specify your own configuration for the various scripts, either by extending the config files provided or just by using your own, depending on the script. Frontwerk respects the convention used by each of its underlying tools (eslint, stylelint, prettier, etc.). Basically, if it’s possible with that tool, it’s possible with frontwerk.
You can find more extensive documentation about each tool in this guide.