-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix: #4695 Reference CommonJS child bundles with a require call #4744
Conversation
@mischnic Is there a timeline for when this can be merged? Keeping a custom runtime plugin up to date is causing some issues for us. |
I'll take a look. |
I removed optimize and deduplicate. Additionally, I've resolved merge conflicts and pulled in upstream changes |
@mischnic Is there any other cleanup I need to do before this can be merged? |
packages/core/integration-tests/test/integration/commonjs-bundle-require/package.json
Outdated
Show resolved
Hide resolved
…le-require/package.json
.../test/integration/commonjs-bundle-require/node_modules/parcel-bundler-splitable/package.json
Outdated
Show resolved
Hide resolved
I would have suggested supporting ESM as well while we're at it, but that can't work yet for other reasons... |
…le-require/node_modules/parcel-bundler-splitable/package.json
↪️ Pull Request
This pull request adds support to JSRuntime for referencing CommonJS child bundles with a require call. No handling of this was present, so the current behavior was to use a URL reference.
Resolves: #4695
💻 Examples
There isn't an easy way to see this in action without a custom bundler. I created a simple one (https://github.com/jfrconley/parcel-bundler-splitable) that allows listing files you want to split the bundle on. The integration test relies on a custom bundler with a hardcoded path to split on.
🚨 Test instructions
Testing is covered by added integration test: commonjs-bundle-require
✔️ PR Todo