Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin does not preserve folder structure source vs destination when using the copy event #94

Closed
yorkish opened this issue Feb 12, 2021 · 11 comments

Comments

@yorkish
Copy link

yorkish commented Feb 12, 2021

Config

new FileManagerPlugin({
  events: {
    onStart: {
      delete: ["dest/**", "webresources/**"],
    },
    onEnd: {
      copy: [
        {
          source: "sources/images/**/*.{png,gif,jpg,jpeg,ico,svg}",
          destination: "webresources/images",
        },
        {
          source: "dest/fonts",
          destination: "webresources/fonts",
        },
        {
          source: "dest/{main,runtime~main,vendors}.bundle.{js,js.map}",
          destination: "webresources/js",
        },
        {
          source: "dest/*.{css,css.map}",
          destination: "webresources/css",
        },
        {
          source: "dest/webresources/images/**/*.{png,gif,jpg,jpeg,ico,svg}",
          destination: "webresources/images",
        },
      ],
    },
  },
});

Issue

backtracked the issue to v3.0.0-alpha.0 on commit Replace cpx, remove fs-extra, update ava

basically under 'sources/images' I have additional folders named svg and favicon.

v3.0.0+ using cpy doesn't create those subfolders in the destination folder anymore as cpx did. everything gets mixed up in the same dest folder 'webresouces/images'

Your Environment

Tech Version
filemanager-plugin-webpack 3.1.0
node 10.15.3
OS linux
@sibiraj-s
Copy link
Collaborator

CPX is replaced with CPY since it is no longer maintained. Unfortunately CPY doesn't allow recursive copy. There is an open PR for that in CPY repo. I am waiting on that.

@zenonhun
Copy link

Any update or workaround for this? CPY doesn't seems to fix this issue anytime soon.

@sibiraj-s
Copy link
Collaborator

I am afraid we may need to wait on it. I am open to suggestions, let me know if you find anything.

@zhangshme
Copy link

Any progress?

@enkelmedia
Copy link

This one is really limiting, is there any plans to address it?

@sibiraj-s
Copy link
Collaborator

@enkelmedia the PR to support this feature is done. sindresorhus/cpy#77. It is in review, hoping it would be merged soon. I will release a patch as soon as it is merged.

@daniel-brenot
Copy link

Bumping because this just ended up causing a delay where i work

@sibiraj-s
Copy link
Collaborator

Since PR is now merged, I can try making an alpha release pointing to the cpy's master branch .

@philipp-winterle
Copy link

Is anything happening here? Or should we move away from filemanager plugin

@sibiraj-s
Copy link
Collaborator

Since PR is now merged, I can try making an alpha release pointing to the cpy's master branch .

I was going to try this. but soon I saw some activity towards release on cpy's repo, then I started waiting for the release. I don't think it will be happening anytime soon. I will see if I can work with its master. or prefer some other library or just do it natively.

@sibiraj-s
Copy link
Collaborator

Tired of waiting on cpy, and next version is ESM only. hence the package is removed and implemented natively. Try v7 alpha. It by default copies everything recursively, flat option is yet to be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants