-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
getmac fails on webpack as webpack doesn't support editions #43
Comments
Ideally we would have webpack and rollup plugins for the editions format, so that any package that has the editions format, people can then elect via a list of preferred tags which edition should be used instead. This would automatically support all editioned packages, and allow consumer bundles to have the most optimum code possible. So users of typescript could elect the preferred tags like I have no experience writing webpack or rollup plugins, but from my evaluation that should be possible. So I am not the right person to do it. And as Bevry earns no money and I earn no money from programming I have no funds to hire anyone else to do it. Considering the amount of installs the editions autoloader gets, a few million a month, it would be good to see his happen though. |
However, it seems your package is just a copy of one of the compiled editions. You could modify your source to point to the specific edition entry point, or use a bundler package alias that aliases getmac to getmac/preferrededition/theentry.js, to work around this issue. This is a benefit of the editions and projectz combo, it makes clear the editions and their entry points in the readme. |
So as an alternative to a webpack/rollup/parcel/whatever/bundler plugin, we could update projectz to provide the webpack/rollup/whatever instructions on how to alias the package to the specific edition. |
For the use case, of bundle to one file with zero other transformations, zeit's ncc package from my testing works fine with editioned packages. Not sure how it does the magic, but it seems to work quite well. Not sure if it works with getmac though. |
Hi, thanks for your detailed answers. For the record, I am smarter this evening than this morning, as I now understand how to handle webpack server side. Basically I should not have bundled the node_modules in the first place, as explained here: https://jlongster.com/Backend-Apps-with-Webpack--Part-I. Thanks again for your reactivity. I am not much familiar with writing npm packages and |
To be clear, the issue is not ours. The issue is with whatever bundler is being used. The bundler must add support for the editions format. Details here: bevry/editions#24 |
Hi, this package does not seem to be compatible with Webpack (server-side) due to the use of
bevry/editions
.I quickfixed this by creating: https://github.com/lbke/getmac-webpack (simply a copy of the relevant source files).
To precise my use case, my Node server needs to be deployed on-premise, but I don't want to send the source as-is to the clients, so I rely on Webpack to build/minify the code the most I can.
I understand that you may not want/have time to fix this as
editions
seems to be a basis for multiple packages and my use case is not common, I just wanted to provide a quick alternative for Webpack user.The text was updated successfully, but these errors were encountered: