# Usage

# Tasks

Change your current terminal directory to the project root with cd path/to/project.

Then run tasks with npm run task-name, e.g. npm run dev.

Task Purpose
dev Starts the development server with file watching and auto reload.
build Builds production-ready files (output to dist) and static export (output to static).
inspect Print the webpack configuration to the console.
lint:css Lints CSS with stylelint (opens new window).
lint:js Lints JavaScript with ESLint (opens new window).

Note

Tasks are pre-defined package.json scripts for the corresponding pangolin-core command.

# JavaScript

JavaScript files are bundled with webpack (opens new window) and transpiled with Babel (opens new window) and the env preset (opens new window). To learn more about JavaScript modules (commonly known as ES modules) head over to the MDN articles for the import (opens new window) and export (opens new window) statements.

ESLint (opens new window) is pre-configured with the JavaScript Standard Style (opens new window). Global ESLint rules (opens new window) are set in .eslintrc.js. Per-file rules can be set with comments (e.g. // eslint-disable no-console). Exclude files from linting (opens new window) with an .eslintignore configuration file.

# CSS

Sass (opens new window) is a CSS preprocessor supporting variables, nesting and mixins – among many other features. For a quick start jump to the Sass Basics (opens new window).

stylelint (opens new window) monitors the code for errors and consistency deviations defaulting to the Sass Guidelines (opens new window)with a few additions. Global stylelint rules (opens new window) are set in stylelint.config.js. Per-file rules can be set with comments (e.g. /* stylelint-disable selector-max-id */). Exclude CSS files from linting (opens new window) with a .stylelintignore configuration file.

# HTML

Nunjucks (opens new window) is an HTML templating engine based on JavaScript. Pangolin.js uses Fractal (opens new window) to create static HTML from Nunjucks files. Take a look at the templating docs (opens new window) for further information on Nunjucks.

The dev task serves the web UI with a built-in web server. The build task generates HTML for static file servers.