Skip to content

Example using node modules with njs #19

@cliffxuan

Description

@cliffxuan

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? 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions