Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

"in-source" config bleeds into node_modules?

$
0
0

One useful trick is to register the JS modules as an exports entry in package.json.

{
  "name": "my-package",
  "exports": {
    "./js-impl": "./src/path/to/impl.js"
  }
}

then you can use @module("my-package/js-impl")

Note that this relies on a feature of Node.js module resolution, so it will only work in ecosystems compatible with it (Node.js, Bun), and other standard ESM environments may need an additional import map to use this.


Viewing all articles
Browse latest Browse all 2592

Trending Articles