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

Replace webpack with Parcel #44

Merged
merged 8 commits into from Mar 3, 2021
Merged

Replace webpack with Parcel #44

merged 8 commits into from Mar 3, 2021

Conversation

fregante
Copy link
Owner

@fregante fregante commented Feb 17, 2021

Closes #34

Based on fregante/GhostText#187, npmhub/npmhub#119, tanmayrajani/notifications-preview-github#113

But this PR introduces some cool changes like the preservation of webextension-polyfill without any bundling whatsoever, so it can be imported globally and once instead of once per bundle.

Wishlist/todo

Current output

❯ nr build
✨ Built in 2.39s

distribution/manifest.json                                                        565 B     92ms
distribution/icon.png                                                           1.14 KB     75ms
distribution/__/node_modules/webextension-polyfill/dist/browser-polyfill.js    36.61 KB    196ms
distribution/background.js                                                     33.61 KB    199ms
distribution/options.html                                                       1.05 KB    686ms
distribution/options.ed4d9118.css                                                 906 B    688ms
distribution/options.a7e143c4.js                                               34.95 KB    689ms

package.json Show resolved Hide resolved
@fregante
Copy link
Owner Author

Another Parcel issue I found is that --no-content-hash doesn't seem to work because options.[hash].js changes hash depending on content.

This isn't an immediate issue here but it's an issue for Safari extensions because (sigh) Xcode configuration files include a static list of files to include.

@mischnic
Copy link

Yeah, I've noticed that as well: parcel-bundler/parcel#5894

@fregante
Copy link
Owner Author

Thank you, excellent!

@fregante
Copy link
Owner Author

fregante commented Mar 3, 2021

Since parcel-bundler/parcel#5858 isn't currently possible, I temporarily avoided that issue altogether with the commit above. This requires the user to manually load the polyfill in every file in order to use the browser API, but at least people can already start using Parcel without us having to wait for a fix.

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

Successfully merging this pull request may close these issues.

Move to Parcel
2 participants