rescript-association / genType

Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript/FlowType.

Home Page:https://rescript-lang.org/docs/gentype/latest/introduction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shims in sub-folder

dmtrKovalenko opened this issue · comments

When shims are used in the subfolder types are importing with ./shims/{Module}.shim without any ability to configure the behavior

My tree

├── bsconfig.json
├── src
│   ├── services
│   │   ├── mediaLoader.bs.js
│   │   ├── mediaLoader.gen.tsx
│   │   └── mediaLoader.res
│   ├── shims
│   │   └── Js.shim.ts

And inside services folder I get

import type {Js_ArrayBuffer_t as ReScriptJs_Js_ArrayBuffer_t} from './shims/Js.shim';

instead of

import type {Js_ArrayBuffer_t as ReScriptJs_Js_ArrayBuffer_t} from '../shims/Js.shim';

bsconfig.json

"gentypeconfig": {
    "language": "typescript",
    "module": "es6",
    "importPath": "relative",
    "exportInterfaces": false,
    "shims": {
      "Js": "Js",
      "ReScriptJs": "shims/Js"
    },
    "debug": {
      "all": false,
      "basic": false
    }
  }

It looks like it is not possible not but required so much

This repository is being archived. If you feel like the issue still relevant, please re-create it in the compiler repo. Thanks!