-
Notifications
You must be signed in to change notification settings - Fork 88
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
Request for browser property in package.json #23
Comments
Hey! The Webpack feature that you want to use should be set in your module.exports = {
//...
resolve: {
mainFields: ['browser', 'module', 'main']
}
}; While libraries should contain one of the following fields: "main", "module" or "browser". The first two are in hybrids Moreover, what you want to do is something, that should be avoided. Built version of the library is only here for those who have to use it directly by If you use Webpack, you should leave default behavior of the Webpack configuration (without set mainFields) and import library like this: import { define } from 'hybrids'; Even with this code, you don't have to transpile code to es5 as it is traspiled already. Only To sum up, this is the mapping from
Feel free to re-open, if you have other questions related to this subject. |
Thanks for the clarification .I originally raised this question so as to have less bundle size for prod but webpack can minify the es6 module i guess. I have more clarity now, but one doubt.
I am using webpack not for transpiling but for bundling (with two configuration dev and prod). If i bundle the code as is with import will i be getting HMR in prod code also? if yes then i how can i turn it off ? |
You don't have to worry. The library uses |
Hello
I've just started using this library and I thought i would start by setting up some webpack prep work. I would like to take advantage of the webpack's resolve mainfields option but noticed it doesn't exist for the library in the package.json. Could you please update it? Would really help with bundling dist file of browser rather than using non minified lib/esm version when bundling. cheers.
The text was updated successfully, but these errors were encountered: