Skip to content
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

Feature request: choice of output extension #15

Closed
Conaclos opened this issue Sep 28, 2021 · 1 comment
Closed

Feature request: choice of output extension #15

Conaclos opened this issue Sep 28, 2021 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@Conaclos
Copy link

Hi! Thanks for your work.

I would like to propose a CLI option to choose the output extension of files and imports. In some cases, it could be useful to output cjs extension or mjs extension. This is useful to publish node package that support both esm and commonjs.

@wojpawlik wojpawlik added the enhancement New feature or request label Sep 29, 2021
@wojpawlik
Copy link
Member

wojpawlik commented Sep 29, 2021

Glad you like my project :)

I doubt changing output extension is useful tho. { "type": "module" } package.json marks all .js files in the directory as ESM. If you write Node-only, Node.js ^12.20.0 || >=14.13.1 allows to use named imports on CJS. And if you need ESM for browsers, https://www.npmjs.com/package/sucrase can transpile to CJS (from ESM) way faster than deno2node.

Still, I wouldn't mind a PR extending https://github.com/wojpawlik/deno2node/blob/main/src/emit.ts to vary output extension based on "target".

@wojpawlik wojpawlik added the wontfix This will not be worked on label Nov 29, 2021
@wojpawlik wojpawlik closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants