PublicAssetsPlugin

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.

Priority

This plugin runs with a priority of -1 so it runs after most other plugins.

Options

PropertyDescription
outputDirThe directory to copy the assets to. Defaults to ./public
assetsA collection of filenames to copy to the outputDir

Adding to Mosaic

Add to the plugins collection:

plugins: [
  {
    modulePath: '@jpmorganchase/mosaic-plugins/PublicAssetsPlugin',
    priority: -1,
    options: {
      outputDir: './public',
      assets: ['sitemap.xml', 'search-records.json']
    }
  }
  // other plugins
];
Mosaic BETA

Coming soon