You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
viteStaticCopy is unreliable for analog(), I tried this myself.
When ssr folder kicks in by building nitro server, the contents of ./ssr/assets get overwritten or an ENOENT error gets thrown, tried this for hours, no luck, I wouldn't rely on this.
@renatoaraujoc i'm using it without a problem, just disable the plugin for ssr builds.
import{Plugin}from'vite';import{viteStaticCopy,TargetasStaticCopyTarget}from'vite-plugin-static-copy';/** * Returns an array of Vite plugins that copy assets from the specified directory to the assets folder. * @return {Plugin[]} An array of Vite plugins for copying assets. */exportfunctionprovideCopyAssetsPlugin(isSsrBuild=false,demo=false): Plugin[]|false{if(isSsrBuild)returnfalse;consttargets: StaticCopyTarget[]=[{src: '../../epmr-assets/layout/fonts/**',dest: 'assets/fonts',overwrite: true},{src: '../../epmr-assets/layout/images/**',dest: 'assets/images',overwrite: true},{src: '../../epmr-assets/layout/styles/**',dest: 'assets/styles',overwrite: true},];if(demo)targets.push({src: '../../epmr-assets/demo/**',dest: 'assets/demo',overwrite: true});returnviteStaticCopy({ targets });}
Which scope/s are relevant/related to the feature request?
Docs
Information
Vite copies everything in the public directory by default to the build output.
There is a common use case where developers want to copy assets from an external location during the build process. This plugin can do it.
https://www.npmjs.com/package/vite-plugin-static-copy
This would add a guide to the docs on copying external assets using this plugin.
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: