The PublicAssetsPlugin is responsible for finding "assets" in the Mosaic filesystem and copying them to another directory.
Typical use-case is for copying sitemap.xml and search-records.json to the public directory of a Next.js site as these are considered static assets for Next.js.
This plugin runs with a priority of -1 so it runs after most other plugins.
| Property | Description |
|---|---|
| outputDir | The directory to copy the assets to. Defaults to ./public |
| assets | A collection of filenames to copy to the outputDir |
Add to the plugins collection:
plugins: [
{
modulePath: '@jpmorganchase/mosaic-plugins/PublicAssetsPlugin',
priority: -1,
options: {
outputDir: './public',
assets: ['sitemap.xml', 'search-records.json']
}
}
// other plugins
];