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

Using automatic paths with ESM #878

Open
mhirsch opened this issue Jun 23, 2023 · 2 comments
Open

Using automatic paths with ESM #878

mhirsch opened this issue Jun 23, 2023 · 2 comments

Comments

@mhirsch
Copy link

mhirsch commented Jun 23, 2023

I noticed in the example project using esm modules the api doc paths are not automatically populated from the properties of the modules in the paths tree ("central doc" vs "filled in by fs-routes") as they are in the basic exaple.

Is there in fact a way to have the paths automatically populated with ESM? I haven't been able to figure it out.

Thanks for your help.

@mhirsch
Copy link
Author

mhirsch commented Jun 23, 2023

I haven't tested if this gives a fully working app, but looking through the source code it seems like I need to pass

initialize({
  ...
  routesGlob: '**/*.mjs',
  routesIndexFileRegExp: /(?:index)?\.mjs$/,
})

in order for fs-routes to find the ESM files.

@mhirsch
Copy link
Author

mhirsch commented Jun 23, 2023

The above (with edits) does seem to work. Can this be added to the docs somewhere?

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