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

Update Instructions: Run 'copy' after bundle created #23

Closed
dadiborn opened this issue Jul 16, 2019 · 2 comments
Closed

Update Instructions: Run 'copy' after bundle created #23

dadiborn opened this issue Jul 16, 2019 · 2 comments

Comments

@dadiborn
Copy link

Thank you for plugin that only made my simple task 'Copy After Bundle was created' working.
Please add into documentation where you talking about default hook information that hooks should be taken from https://rollupjs.org/guide/en/#plugin-development and if we need to run 'copy' after bundle was made and written to drive, we need to use writeBundle hook like so copy({hook:'writeBundle',[..]})

And better to start your description that by default plugin runs before bundle was written to disk due default hook named 'buildStart'

To get into that point i spend a lot of time and was almost ready to write my own plugin because after one hour of digging into api i understand how it works now lol - it is good for me but thats the purpose of work you have done >> to just plug it in without any googling

@vladshcherbin
Copy link
Owner

@dadiborn hey, I've updated hooks option description with your suggestions.

By default, buildEnd hook is used because there are some things to know when using other hooks, for example if you have multiple chunks - writeBundle hook will be executed multiple times and the plugin will also copy files multiple times. This is why hook option is like an advanced one, for users who have some kind of rollup hooks knowledge :)

Thanks for using this plugin, readme clarification suggestion and sorry for the inconvenience. ❤️

@doriclaudino
Copy link

Hello @dadiborn and @vladshcherbin I tried the plugin and work nice.
Got some headache to figure out all the hooks available on rollup.js (pretty much on the building order, cause I knew my file is generated but I didn't know on which stage) and which one will catch my situation.

using default hook:
image

using hook 'onwrite':
image

For some reason my file is generated "see blue strings" but is not copied together.
So For debug reasons try:

verbose: true,
hook: 'onwrite'

Hope my comment help someone on the future 💃

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

3 participants