ga4gh / gh-openapi-docs

Package for building OpenAPI schema docs and UI for gh-pages
Apache License 2.0
7 stars 5 forks source link

Use babel resolvers instead of 'absolute' imports #27

Open jaeddy opened 4 years ago

jaeddy commented 4 years ago

Looking back to these comments in #22:

image

The @lib/environment import apparently gets interpreted (when trying to use babel-node to compile and execute an ES6+ formatted script) as a module/dependency:

Error: Cannot find module '@lib/environment'

It looks like we might be able to use babel-plugin-module-resolver to achieve similar aliasing benefits, but with more control and (hopefully) more flexibility for local testing.

tschaffter commented 4 years ago

I have used a similar approach here: https://github.com/Sage-Bionetworks/sagebio-collaboration-portal/blob/b83bb3a2af92e1596724682a642bb78d7bf7e226/webpack.make.js#L78

I'll create a PR that addresses this ticket.