You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the guide for using the js_include directive only? With js_include an export default {...} statement isn't needed at the end of the bundled js file. However, js_import requires this export default {...} statement, which undoes the effort by the load.js in the global namespace.
The text was updated successfully, but these errors were encountered:
You can use js_import with node modules but you are correct about the requirement for an export statement. However, the export can be for an empty function. You can simply add 2 lines to your .js file
@lcrilly Thanks very much for the reply with the solution as well as the reference to the complete example. I can see it working and will give it a try.
Thanks for all these nice examples.
Can you please also create an example for using 3rd party node modules? Or is it still supported after the removal of the
js_include
directive?I've been following this guide, however, it doesn't seem to work.
https://nginx.org/en/docs/njs/node_modules.html
Is the guide for using the
js_include
directive only? Withjs_include
anexport default {...}
statement isn't needed at the end of the bundled js file. However,js_import
requires thisexport default {...}
statement, which undoes the effort by theload.js
in the global namespace.The text was updated successfully, but these errors were encountered: