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 addBundleLoader to accept multiple targets #1085

Merged
merged 1 commit into from
Apr 8, 2018

Conversation

fathyb
Copy link
Contributor

@fathyb fathyb commented Mar 28, 2018

Follow up to #981 based on @devongovett comment :

would be cool to add support for registering bundle loaders for specific environments. this would allow third party plugins to do the same:

bundler.addBundleLoader('wasm', {
 node: require.resolve('./node/wasm-loader'),
 browser: require.resolve('./browser/wasm-loader')
});

src/Bundler.js Outdated
if (typeof path !== 'string') {
throw new Error('Bundle loader should be a module path.');
addBundleLoader(type, paths) {
if (typeof paths !== 'object') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's a string, we could just assign the same file to all targets.

@fathyb fathyb force-pushed the fathy/update-addBundleLoader branch from f3a5cd0 to c547084 Compare March 29, 2018 18:06
@fathyb fathyb force-pushed the fathy/update-addBundleLoader branch from c547084 to 440d42b Compare March 29, 2018 18:10
@devongovett devongovett merged commit 9f3f30a into master Apr 8, 2018
@devongovett devongovett deleted the fathy/update-addBundleLoader branch April 8, 2018 07:53
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.

None yet

2 participants