Since the option accepts a regular string, by passing that value to await import the library was importing a file based on the current file position (e.g. node_modules/elm-tailwind-modules/dist/cli.js when using it as an external dependency). We need to the caller position so the imported path makes sense for the end user (e.g. calling it from an npm script).
Fixes #1 .
Goal
Say a have a project with the structure like this:
This change makes it possible to call the
--tailwind-config
like this:Problem
Currently, I need to specify to full relative path based on the internal structure of the publish elm-tailwind-modules package:
Why it was happening
Since the option accepts a regular string, by passing that value to
await import
the library was importing a file based on the current file position (e.g.node_modules/elm-tailwind-modules/dist/cli.js
when using it as an external dependency). We need to the caller position so the imported path makes sense for the end user (e.g. calling it from an npm script).