-
Notifications
You must be signed in to change notification settings - Fork 19
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
ESM support? #63
Comments
Hi @H01001000 |
Mainly about importing, esm need import extension, where input and builder file I can manually add .js at back, but for example utils and object.base don’t have import extension |
You are needing to replace imports with For example: ? Although I don't understand exactly why, if this is the case perhaps you could use the |
@H01001000 If I understand correctly the way your project is configured, you need the .ts at the end of each import, right? |
@Cauen In simple words, ESM can works with // Same with TypeScript targeting ESM
import { } from "./script.js"
import { } from "./dir/index.js" CommonJS can works with both const { } = require("./script");
const { } = require("./script.js");
const { } = require("./dir");
const { } = require("./dir/index.js"); // TypeScript target CJS
import { } from "./script"
import { } from "./script.js"
import { } from "./dir"
import { } from "./dir/index.js" |
@Cauen sorry for the late reply, it should for now, I did is generate it as a separate package with type commonJS, and import it to main pkg p.s. is type checking possible? tsc with |
Our lib today generates typescript code, right? Could you send me some minimal example of the problem you have there? In the develop branch, i've created an example with Is the problem you face with the build? |
@Cauen MRE: add |
Hi @H01001000 |
sure, btw what yarn version you using? it seem the yarn is not up to date, want we pr it? |
Feel free to update it :) My version: 1.22.21 |
@Cauen btw I found out that when simple is false, tsc runs out of the heap when compiling my input.ts file. Is it possible to split the input file for each model? |
Hello, it is not mentioned in the README, but I wonder does it supports outputting ESM module?
The text was updated successfully, but these errors were encountered: