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

feat: support ESM config files #414

Merged

Conversation

achingbrain
Copy link
Collaborator

Uses import for dynamic module imports allowing you to use ESM as a config file.

Also lets you return a function that returns a promise to get the config in case you need to do some async work to retrieve it from somewhere.

Fixes #413

Uses `import` for dynamic module imports allowing you to use ESM
as a config file.

Also lets you return a function that returns a promise to get the
config in case you need to do some async work to retrieve it from
somewhere.

Fixes hugomrdias#413
Copy link
Owner

@hugomrdias hugomrdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just one small request

cli.js Outdated
Comment on lines 161 to 166
config = await lilconfig('playwright-test', {
loaders: {
'.js': loadEsm,
'.mjs': loadEsm,
},
}).load(path.resolve(opts.config))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can hoist this up to avoid duplication please

{
  loaders: {
    '.js': loadEsm,
    '.mjs': loadEsm,
  },
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@achingbrain achingbrain merged commit 3f731c8 into hugomrdias:master Apr 6, 2022
@achingbrain achingbrain deleted the feat/support-esm-config-files branch April 6, 2022 11:32
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

Successfully merging this pull request may close these issues.

Support ESM config files
2 participants