Skip to content

Comments

Build script to setup ESM/CJS module exports#384

Open
gfortaine wants to merge 1 commit intoterkelg:masterfrom
gfortaine:master
Open

Build script to setup ESM/CJS module exports#384
gfortaine wants to merge 1 commit intoterkelg:masterfrom
gfortaine:master

Conversation

@gfortaine
Copy link

No description provided.

MultiselectPrompt,
AutocompletePrompt,
AutocompleteMultiselectPrompt,
ConfirmPrompt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better as named exports.

"scripts": {
"start": "node lib/index.js",
"prebuild": "rm -rf dist",
"build": "tsc -p ./tsconfig.cjs.json && tsconfig-to-dual-package ./tsconfig.cjs.json",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're interested, pkgroll offers this with zero-config.

@longnguyen2004
Copy link

How is this going? prompts isn't working with ts-node-esm, so I'd really want an ESM version of this library

@marckraw
Copy link

Yeah, same, would like to use it with native esm ;)

@ctsstc
Copy link

ctsstc commented Nov 30, 2023

Is there any temporary solution for now to utilize this in an ESM environment until support is added? I would prefer to avoid build steps or transpilation if possible on the consuming side.

I tried to switch my script over to cjs, but then I lose top level awaits :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants