Skip to content

Vite doesn't copy nested folders #117

Description

@bidi47

this was tested in a new Light project, but it warrants further testing

  • the current filter under src matches only the top-level files, not the nested folders, so only the files in App/assets/fonts and App/assets/images are copied to public
  • stripBase: true flattens nested folders, instead of maintaining the folder structure

i recommend this change for the current lines 7-20

viteStaticCopy({
            targets: [
                {
                    src: 'App/assets/fonts/**/*',
                    dest: 'fonts',
                    rename: { stripBase: 3 },
                },
                {
                    src: 'App/assets/images/**/*',
                    dest: 'images/app/',
                    rename: { stripBase: 3 },
                },
            ],
        }),
  • **/* matches all files and nested folders
  • stripbase: 3 to remove the prefix, e.g. App/assets/fonts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions