Build tools to help with building and deploying websites at Aptuitiv.
npm i - D @aptuitiv/website-build-tools
There are two ways to call the build tools.
The first, and recommended way is to call this from the scripts
section of your package.json
file.
"scripts": {
"start": "npm run watch",
"pull-templates": "aptuitiv-build pull-templates",
"push-templates": "aptuitiv-build push-templates",
"watch": "aptuitiv-build watch"
}
See the Package.json page for a full list of recommended scripts.
The other way is using the command line.
aptuitiv-build pull-template
These build tools expect the following project structure:
- build - The folder that the CSS, Javscript, templates and other assets are built to. The contents of this folder are uploaded to the website via FTP.
- src - The source folder for the CSS, Javascript, template, and other assets.
- config The folder holding the theme configuration files
- css The CSS files for the project.
- fonts Any self-hosted fonts needed for the project.
- icons Any SVG icons to complile into a sprite.
- js Any Javascript files for the project.
- templates The Twig template files.
- .aptuitiv-buildrc.js - The configuration file for the build tools.
- .env - The environment file that holds the FTP credentials.
You can configure different paths for your assets in the configuration file, but we recommend keeping this structure for consistency between projects.
While not required for the build tools, is recommended that you also have the following configuration files in the root of your project.
- .editorconfig
- .gitignore
- .prettierignore
- .prettierrc.cjs