-
Notifications
You must be signed in to change notification settings - Fork 46
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
Build minified and unminified bundles #253
Conversation
Debatable indeed because the browser field is always used by the bundler like browserify/webpack. |
Mmm, this is interesting. I haven't really been thinking about downstream bundling concerns, because if you're bundling downstream generally you don't want us to provide a browser bundle. As you mention for in the UI case, for example, we really want to just depend on the raw source so that everything gets deduped and you can control bundling yourself, and I think that probably holds for nearly 100% of other bundling users too. I can't think of any reason you'd normally want the bundle in these cases. Given that, the use case for the bundle is in non-commonjs bundled environments - raw globals, requirejs, maybe more exotic things. I don't think any of other options use the |
Yes I think that's the proper way to go.
…On Tue, Jan 10, 2017 at 7:18 PM, Tim Perry ***@***.***> wrote:
Mmm, this is interesting. I haven't really been thinking about downstream
bundling concerns, because if you're bundling downstream generally you
don't want us to provide a browser bundle.
As you mention for in the UI case, for example, we really want to just
depend on the raw source so that everything gets deduped and you can
control bundling yourself, and I think that probably holds for nearly 100%
of other bundling users too. I can't think of any reason you'd normally
want the bundle in these cases.
Given that, the use case for the bundle is in non-commonjs bundled
environments - raw globals, requirejs, maybe more exotic things. I don't
think any of other options use the browser field, so we should actually
just drop it entirely, and have everything that uses package.json get the
non-bundled version, and people use the bundled version only when they're
setting things up manually. Does that sound reasonable?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgGCC6d7dUr8DArJDjKleh1OQ_DPgMEks5rQ69zgaJpZM4LfhQ4>
.
--
Eugene Mirotin
Senior Frontend Engineer
site: Resin.io <https://resin.io/>, twitter: @resin_io
<https://twitter.com/resin_io>
|
1f2b9ed
to
73a56dd
Compare
@@ -2,6 +2,8 @@ karmaConfig = require('resin-config-karma') | |||
packageJSON = require('./package.json') | |||
{ loadEnv } = require('./tests/util') | |||
|
|||
BROWSER_BUNDLE = "build/resin-browser.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary double quotes are forbidden.
73a56dd
to
4e73a2c
Compare
Ah, wait. There's still the other module-exclusion bundling problem. The config in this module currently lets us exclude some of its deps, which keeps downstream bundles smaller, and we don't share any of that info if we don't use the bundle when bundling downstream. Interesting... This is where the For now though, as above, I think we still want to drop the I've now pushed a |
We can pick up a separate task later to provide
browserify/webpack-friendly builds with automagically exclude the right
dependencies, since that's a larger job and it should be easily backward
compatible anyway.
Yeah I've mentioned that as a nice to have thing though I don't know yet
how to implement it properly.
Anyway right now the only browser consumer is us indeed so in the works
case other users would just get suboptimal bundle size.
LGTM to merge.
Could you also add a small section to the readme listing the modules that
can be safely dropped when bundling for the browser?
…--
Eugene Mirotin
Senior Frontend Engineer
site: Resin.io <https://resin.io/>, twitter: @resin_io
<https://twitter.com/resin_io>
|
087c852
to
bb29733
Compare
Readme note added, merging. |
I've defaulted to the minified version (by setting that as .browser in package.json), which I think is probably preferable, but up for debate.