-
Notifications
You must be signed in to change notification settings - Fork 455
Pass moduleMain option to generator #316
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
base: master
Are you sure you want to change the base?
Conversation
|
+1 |
|
Yes, please! The default main breaks commonjs modules used in browser ( |
|
Anything missing here? Any way to help? |
| settings.moduleName = opts.moduleName; | ||
| } | ||
| if (opts.moduleMain) { | ||
| settings.moduleMain = opts.moduleMain; |
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.
No parsing necessary here?
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.
I think it's just a string of source code, isn't it?
|
It would be great to have this, making people stub out |
|
For now it seems I can install the forked version, like this: |
Allows using the
--moduleMainargument with the command-line interface, to define an alternateexports.mainimplementation.Without this change, it is only possible (as far as I can tell) to set
moduleMainthrough the module API but not the CLI. (You can also specify%option moduleMainin the grammar jison input file, but it generates invalid JavaScript then - only appears to be possible set it to "true", but a function is required).Tested this change with
make test, all pass