Skip to content

Suggestion: add import/export support with esm #7

@reks-scripts

Description

@reks-scripts

First, thank you for hapi-starter-kit. I have tried at least half a dozen different npm packages that all claim they create your swagger for you but they all came up short of that promise until I found hapi-starter-kit. This is the only true, out of the box, node/swagger solution I've found so thank you again.

One thing I did in my hapi-starter after I got it up and running, was to add support for import/export using esm. It was pretty much seamless. I moved the contents of the root index.js into a new file called main.js and then changed index.js to this:

// eslint-disable-next-line no-global-assign
require = require('esm')(module)
module.exports = require('./main.js')

And that's all there was to it. Just thought I'd offer it up as a suggestion since hapi-starter-kit is ES8/ES2017 friendly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions