Asset Files

Any files that you add to your template sources will be copied over to the root of the build destination directory, so you can organize your email templates as needed.

Global assets

You may define a global email assets folder that will be copied to the build directory. The Starter sets it to the src/images directory:

config.js
module.exports = {
build: {
templates: {
assets: {
source: 'src/images',
destination: 'images'
}
}
}
}

Everything inside assets.source will be copied to the assets.destination directory, which is relative to templates.destination.path.

Multiple sources

You may define multiple asset source paths by using an array - all files will be copied to a single destination directory:

config.js
module.exports = {
build: {
templates: {
assets: {
source: ['src/images', 'src/fonts'],
destination: 'assets'
}
}
}
}

Multiple destinations

You can output different assets to different folders by using an array of objects:

config.js
module.exports = {
build: {
templates: {
assets: [
{
source: 'src/images',
destination: 'images'
},
{
source: 'src/fonts',
destination: 'fonts'
}
]
}
}
}
Copyright © 2024 Maizzle SRLBrand policy
Edit this page on GitHub