NuxtN
Nuxt2y ago
11 replies
Mark Brouch

How do you add a directory of files to publicAssets at build time?

I'm trying to add a directory of files (wasm and tflite models) to my publicAssets directory at build time so that my application can access these files by url during runtime.

It seems that the way to do this would be via the Nuxt config:
export default defineNuxtConfig({
// ...
nitro: {
  publicAssets: [
    {
      baseURL: 'my_assets',
      dir: 'node_modules/path/to/the/assets
    }
  ]
}
})


However, with this config I don't see the assets in my .output/public dir after building either dev or production. Is this a bug, or is there a different way to acheive this?
Was this page helpful?