unbuild icon indicating copy to clipboard operation
unbuild copied to clipboard

add `copy` builder

Open pi0 opened this issue 1 year ago • 1 comments

Ref: https://github.com/nuxt/module-builder/issues/63

A builder similar to mkdist but copy them as is without any transforms. (We might support small things like ignore patterns)

pi0 avatar May 24 '23 10:05 pi0

Any updates on this?

Want to copy some default static assets (fonts, default pure string based templates) that included by my library as default without any transformation and without any import & export abilities.

I currently use this as workaround:

hooks: {
    'build:done': async () => {
      // copy all things under src/assets to dist/assets
      const { copy } = await import('fs-extra')
      await copy('src/assets', 'dist/assets')
    },
  },

Is this the correct way of using it?

nekomeowww avatar Mar 14 '24 04:03 nekomeowww