Skip to content

Not working well in a Laravel project using Vite #68

@Morinohtar

Description

@Morinohtar

Using

  • Laravel v9.30
  • vite v3.1.0
  • rollup-plugin-copy v3.4.0

Issue

I'm using the plugin in a Laravel project with Vite.

I have this part of code inserted in the vite.config.js file:

copy({ 
  targets: [{
      src: 'resources/themes/xpto',
      dest: 'public/build/assets'
  }],
  flatten: true,
  copyOnce: true,
  verbose: true,
}),

When i run the command npm run dev the plugin seems to not do anything, nothing is copied, but then if i change something in the vite.config.js file the vite watcher executes again automatically and this time the plugin works as expected and the folder is copied:

[vite] vite.config.js changed, restarting server...
copied:

  /var/www/html/resources/themes/xpto→ /var/www/html/public/build/assets/xpto
[vite] server restarted.

So far i haven't figured out how to make it work at first instruction. I tried a couple different hooks too, but to no avail.

Any ideas? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions