npm run build
- builds production files
- copies the font files
- increases the build version number
npm run dev
- builds dev files
- increases the build version number
Copies font files from node_modules to elsewhere. Fonts must be in the dependencies in the package.json file.
It will copy fontawesome free/pro fonts and all @fontsource fonts installed.
fontCopy(target, root = null)
target- target directoryroot- where thenode_modulesfolder can be found. Default: current working directory
$fontDirectory: "fonts/";
@import "@fortawesome/fontawesome-free/scss/variables";
$fa-font-path: $fontDirectory + "fontawesome-free";
@import "@fortawesome/fontawesome-free/scss/brands";
@import "@fortawesome/fontawesome-free/scss/solid";
@import "@fortawesome/fontawesome-free/scss/fontawesome";@use "@fontsource/baloo-da-2/scss/mixins" as BalooDa2;
@include BalooDa2.fontFace($fontDir: $fontDirectory + "baloo-da-2", $weight: 400);
@include BalooDa2.fontFace($fontDir: $fontDirectory + "baloo-da-2", $weight: 800);Can write a build number (based on the current timestamp) into several places.
BuildNumber.bump(packageJson = null, key = "build-number")Updates the build number value in the package json file
packageJson- the file to be updated. Default:cwd + package.jsonkey- the key to be updated
BuildNumber.inject(file, pattern = /__BUILD_NUMBER__/g, replace = (version) => version.toString())Injects to the build number into a file
file- to be modifiedpattern- regex pattern to replacereplace- the replace function
BuildNumber.write(file)Writes the build number into a file
file- to be written
BuildNumber.touch(file)Touches a file
file- to be touched