-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
A bundle should be a module #4202
Comments
how should those bundles be consumed if the browser does not have native support for es6? :) |
By Webpack or SystemJS. Notice: An |
@paleo There is libraryTarget config option that does what you are suggesting a I see there is some discussion around supporting es2015 modules (formerly es6). #2933. |
@gbakernet Thank you. :) |
What is the current behavior?
A bundle generated by Webpack cannot be used as a module.
What is the expected behavior?
We should have the ability to make bundled modules.
For example:
Then the webpack bundling would generate a single file:
The modules
libA
andlibB
are not accessible from outside the bundle. But I suggest that all exported members ofentry
(the entry point defined inwebpack.config.js
) could be exported by the bundle.Use cases
Native support for ES6 modules is coming in browsers. We should be able to use Webpack bundles as native modules.
Even now. I currently generates my bundled libraries without Webpack by concatenating files and append exports because I didn't find how to export something from a bundle.
The text was updated successfully, but these errors were encountered: