-
Notifications
You must be signed in to change notification settings - Fork 361
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
A typescript package that supports both commonjs and esmodule should generate .d.ts
and .d.cts
type files, now only .d.ts
#1030
Comments
.d.ts
and .d.cts
life files, now only .d.ts
.d.ts
and .d.cts
type files, now only .d.ts
Specifically, the TypeScript docs say:
|
While that's indeed the position of the TS team now, for the past 6+ years, ESM |
I just switched over to From attw: tailwindcss-default-shades v0.0.19 The instructions to resolve this are to output both |
Then you'll probably be better served elsewhere -- I don't find TS's changes here to be particularly compelling (as it causes no real issue anyhow) and no one else has invested time to land this, so this issue will probably persist. Edit: This is OSS ran by people volunteering free time; you're not a customer we're trying to keep. To start off a reply saying you'll go elsewhere unless maintainers support your feature request is incredibly demanding and rude. If this tool doesn't fit your needs, please, there's a world of great software out there. |
@rschristian Hi there! Sorry, in no way did I mean what I said to be rude or demanding. I was attempting to provide an example of how this might be seen as important. As a new adopter of the tool, I'm finding it genuinely challenging to use, as it conflicts with other common build tools that expect both This is not meant in any sort of demanding way. I thought it would be more constructive to the team to mention my observation and experience here rather than silently switch to an alternative, in case there is an opportunity to meet this need, perhaps due to my new shared information (the conflicts with other build tools). If there's not, I completely understand. OSS is hard work, and I truly respect and appreciate the team working on microbundle. I was just introduced to the tool today, and I found it exceptionally simple to use in comparison to other tools. That's why I'm so bummed it conflicts with my other build tools. Thanks again 🙂 |
@rschristian I also wonder if there could be a simple workaround, even in user land, such as duplicating the |
Unfortunately, this is unlikely. To copy/paste from MDN: // Exporting declarations
export let name1, name2/*, … */; // also var
export const name1 = 1, name2 = 2/*, … */; // also var, let
export function functionName() { /* … */ }
export class ClassName { /* … */ }
export function* generatorFunctionName() { /* … */ }
export const { name1, name2: bar } = o;
export const [ name1, name2 ] = array;
// Export list
export { name1, /* …, */ nameN };
export { variable1 as name1, variable2 as name2, /* …, */ nameN };
export { variable1 as "string name" };
export { name1 as default /*, … */ };
// Default exports
export default expression;
export default function functionName() { /* … */ }
export default class ClassName { /* … */ }
export default function* generatorFunctionName() { /* … */ }
export default function () { /* … */ }
export default class { /* … */ }
export default function* () { /* … */ }
// Aggregating modules
export * from "module-name";
export * as name1 from "module-name";
export { name1, /* …, */ nameN } from "module-name";
export { import1 as name1, import2 as name2, /* …, */ nameN } from "module-name";
export { default, /* …, */ } from "module-name";
export { default as name1 } from "module-name"; There's a lot of ways to export values w/ ESM, and translating them to CJS would be pretty tricky. A few of these are probably irrelevant, but as we do use TS (through Now, we likely could override the user's
Honest question, what build tools are these? I've never seen a build tool that would take |
Took a better look at it today, appears that |
typescript 文档请参考:https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html#packagejson-exports-imports-and-self-referencing
package.json
The text was updated successfully, but these errors were encountered: