Skip to content
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

Suggestion: add import/export support with esm #7

Open
reks-scripts opened this issue May 15, 2018 · 0 comments
Open

Suggestion: add import/export support with esm #7

reks-scripts opened this issue May 15, 2018 · 0 comments

Comments

@reks-scripts
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant