From 0c718a264400f90859f209fa04d15ac114e7146e Mon Sep 17 00:00:00 2001 From: Chauncey McAskill Date: Thu, 5 Jan 2023 10:37:52 -0500 Subject: [PATCH] Update Development documentation Changed: - Bumped NPM requirement. - Added note about benefits of using NVM. - Added note about support for PurgeCSS to Styles task. - Added details about Versions task. --- docs/development.md | 48 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/docs/development.md b/docs/development.md index 7c277a3..49f244a 100644 --- a/docs/development.md +++ b/docs/development.md @@ -15,6 +15,7 @@ * [`scripts`](#scripts) * [`styles`](#styles) * [`svgs`](#svgs) + * [`versions`](#versions) --- @@ -28,7 +29,9 @@ Learn more about the boilerplate's [tasks](#tasks) below. Make sure you have the following installed: * [Node] — at least 14.17, the latest LTS is recommended. -* [NPM] — at least 6.0, the latest LTS is recommended. +* [NPM] — at least 8.0, the latest LTS is recommended. + +> 💡 You can use [NVM] to install and use different versions of Node via the command-line. ```sh # Switch to recommended Node version from .nvmrc @@ -262,8 +265,8 @@ See [`scripts.js`](../build/tasks/scripts.js) for details. ### `styles` -A wrapper around [node-sass] (and optionally [Autoprefixer] via [PostCSS]) -for compiling and minifying Sass into CSS. +A wrapper around [node-sass] (with optional support for [Autoprefixer] +via [PostCSS]) for compiling and minifying Sass into CSS. By default, [PostCSS] and [Autoprefixer] are installed with the boilerplate. @@ -298,6 +301,9 @@ Example: See [`styles.js`](../build/tasks/styles.js) for details. +The task also supports [PurgeCSS] to remove unused CSS. +See the [documentation on our Grid System](grid.md#build-tasks) for details. + ### `svgs` A wrapper around [SVG Mixer] for transforming and minifying SVG files @@ -328,6 +334,41 @@ Example: See [`svgs.js`](../build/tasks/svgs.js) for details. +### `versions` + +A task to create and update keys for use in versioning assets. + +Can generate a hexadecimal value (using random bytes) or +use the current timestamp. + +Example: + +```json +{ + "versions": [ + { + "format": "timestamp", + "key": "now", + "outfile": "./assets.json" + }, + { + "format": "hex:8", + "key": "hex", + "outfile": "./assets.json" + } + ] +} +``` + +```json +{ + "now": 1665071717350, + "hex": "6ef54181c4ba" +} +``` + +See [`versions.js`](../build/tasks/versions.js) for details. + [Autoprefixer]: https://npmjs.com/package/autoprefixer [BrowserSync]: https://npmjs.com/package/browser-sync [concat]: https://npmjs.com/package/concat @@ -340,5 +381,6 @@ See [`svgs.js`](../build/tasks/svgs.js) for details. [NPM]: https://npmjs.com/ [NVM]: https://github.com/nvm-sh/nvm [PostCSS]: https://npmjs.com/package/postcss +[PurgeCSS]: https://purgecss.com/ [SVG Mixer]: https://npmjs.com/package/svg-mixer [tiny-glob]: https://npmjs.com/package/tiny-glob