Build tools configuration
Configuration file
You can optionally set a configuration file to override any of the default configuration below. The following places are searched for the configurtation.
- An
aptuitiv-buildproperty in thepackage.jsonfile. - An
.aptuitiv-buildrcfile in JSON or YAML format. We recommend that you add the correct extension to the file (e.g..json) to end up with one of the following file names:.aptuitiv-buildrc.json,.aptuitiv-buildrc.yaml,.aptuitiv-buildrc.yml
- An
.aptuitiv-buildrc.js,.aptuitiv-buildrc.ts,.aptuitiv-buildrc.mjs, or.aptuitiv-buildrc.cjsfile. aptuitiv-build.config.mjsor.aptuitiv-buildrc.mjsfile usingexport default(ES module)aptuitiv-build.config.cjsor.aptuitiv-buildrc.cjsfile usingmodule.exports(CommonJS)- An
aptuitiv-buildrc,aptuitiv-buildrc.json,aptuitiv-buildrc.yaml,aptuitiv-buildrc.yml,aptuitiv-buildrc.js,aptuitiv-buildrc.ts,aptuitiv-buildrc.mjs, oraptuitiv-buildrc.cjsfile inside a.configsubdirectory. - An
aptuitiv-build.config.js,aptuitiv-build.config.tsfile.
Which module system to use depends on your default module system configuration for Node.js (e.g., "type": "module" in package.json).
ES module example:
export default {
"javascript": {
"files": [
"filename.js",
"subFolder/my-file.js"
]
}
};
CommonJS example:
module.exports = {
"javascript": {
"files": [
"filename.js",
"subFolder/my-file.js"
]
}
};
JSON example:
{
"javascript": {
"files": ["file1.js", "test.js"]
}
}
See these examples:
Configuration options
| Name | Default | Description |
|---|---|---|
| build | The build folder configuration. | |
| build.base | 'dist' | The root build folder for the files to publish to the website. This is used when uploading files via FTP. |
| build.theme | 'dist/theme/custom' | The build folder path for all files for the theme. This is used when uploading files via FTP. |
| css | The CSS configuration. | |
| css.build | 'css' | The folder for the CSS files within the theme build folder. (config.build.theme) |
| css.buildFiles | '*.css' | The glob for CSS file(s) that import the other CSS files. This is used when building the files. This is within the root source folder. (config.src) |
| css.src | 'css' | The source folder for the CSS files within the root source folder. (config.src) |
| copy | [] | An array of file globs to copy and their destination folders. See copy files action. |
| eslint | Eslint configuration. | |
| fonts | Font file configuration. | |
| fonts.build | 'fonts' | The folder for the fonts within the theme build folder. (config.build.theme) |
| fonts.src | 'fonts' | The source folder for the fonts within the root source folder. (config.src) |
| ftp | FTP configuration. | |
| ftp.notify | true | Whether to do a growl notification when a file is uploaded or deleted via FTP. |
| icons | [{build: 'snippets/svg-icons.twig', src: 'icons'}] | Icon file configuration. |
| images | Image file configuration. | |
| images.build | 'images' | The folder for the images within the theme build folder. (config.build.theme) |
| images.optimizations | Image optimization configuration. | |
| images.optimizations.jpg | JPG image optimization configuration | |
| images.optimizations.png | PNG image optimization configuration | |
| images.optimizations.webp | WebP image optimization configuration | |
| images.src | 'images' | The source folder for the image files within the root source folder. (config.src) |
| javascript | Javascript configuration. | |
| javascript.build | 'js' | The folder for the javascript files within the theme build folder. (config.build.theme) |
| javascript.bundles | [] | An array of file globs to bundle and their destination folder. |
| javascript.entryPoints | [] | An array entry point files to build within the src folder using esbuild. |
| javascript.esConfig | An object containing custom configuration for esbuild. | |
| javascript.files | [] | An array of file globs to process. |
| javascript.minify | Minification options for terser. | |
| javascript.src | 'js' | The source folder for the javascript files within the root source folder. (config.src) |
| root | process.cwd() | The root folder for all the project files. If you need to change this then you should put it as the absolute path to the root of their project. |
| src | 'src' | The root folder to the source files. |
| stylelint | Stylelint configuration options. | |
| templates | Twig template file configuration. | |
| templates.build | 'templates' | The folder for the theme twig templates within the theme build folder. (config.build.theme) |
| templates.src | 'templates' | The source folder for the theme twig templates within the root source folder. (config.src) |
| themeConfig | Theme configuration files configuration. | |
| themeConfig.build | 'config' | The folder for the theme config files within the theme build folder. (config.build.theme) |
| themeConfig.src | 'config' | The source folder for the theme config files within the root source folder. (config.src) |
Build configuration
You can adjust the build folders with the build configuration.
{
build: {
base: 'dist',
theme: 'dist/theme/custom'
}
}
Font configuration
You can specify the build and source folders for the font files with the fonts configuration.
{
fonts: {
build: 'fonts',
src: 'fonts',
}
}
FTP configuration
You can configure the FTP behavior with the ftp configuration.
{
ftp: {
notify: false
}
}
Template configuration
You can configure the Twig template file build and source folders with the templates configuration.
{
templates: {
build: 'templates',
src: 'templates',
}
}
Theme configuration files configuration
You can configure the theme configuration file build and source folders with the themeConfig configuration.
{
themeConfig: {
build: 'config',
src: 'config',
}
}