Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Explain why #1

Closed
jacwright opened this issue May 18, 2019 · 6 comments
Closed

Explain why #1

jacwright opened this issue May 18, 2019 · 6 comments

Comments

@jacwright
Copy link

In your readme you share what the only difference is between this plugin and the original. You don't explain why that is important or why I would choose this project over the other. I would like to know why it is important.

Thanks!!

@Rainrider
Copy link
Owner

Rainrider commented May 20, 2019

Sorry for the late reply. Workbox build picks the files from disk, writeBundle is the right hook for that.

From rollup documentation

generateBundle
Type: (options: OutputOptions, bundle: { [fileName: string]: AssetInfo | ChunkInfo }, isWrite: boolean) => void
Kind: async, sequential

Called at the end of bundle.generate() or immediately before the files are written in bundle.write(). To modify the files after they have been written, use the writeBundle hook. bundle provides the full list of files being written or generated along with their details:

@jacwright
Copy link
Author

I appreciate the added info, but I still don't full understand why. Sorry for being slow here.

It this change added because the plugin doesn't work with generateBundle at all? Or is it because the files, in some cases, can be changed before writeBundle, so it is best to wait? Or is it purely a semantic thing the bugged you when you looked at the code?

And if this is the only change, should it be contributed back to the main branch to fix the error?

@frederikhors
Copy link
Contributor

@jacwright IMO writeBundle is better than generateBundle. But if you don't modify files after all steps don't worry.

@Rainrider
Copy link
Owner

Rainrider commented May 26, 2019

@jacwright
When generateBundle is fired, the bundle has not been written to disk yet, so Workbox will either get your old files or none at all if you clean up your build destination before the build.

And if this is the only change, should it be contributed back to the main branch to fix the error?

I did open a pull request over at gitlab where the original repo is, however no one responded to it, so I figured the project was abandoned.

@jacwright
Copy link
Author

Thank you!

@frederikhors
Copy link
Contributor

I did open a pull request over at gitlab where the original repo is, however no one responded to it, so I figured the project was abandoned.

Let's make this the official project.

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

No branches or pull requests

3 participants