Closed uladzimirdev closed 2 months ago
zx exposes zx/globals
entry point, which will be resolved as ESM via import
, and as CJS module when the require
API is used.
import 'zx/globals' // esm
require('zx/globals') // cjs
@antongolub afaik bundlers like esbuild, webpack etc are able to read exports part of package.json and load correct file based on the target of the builds (esm/cljs/etc), so it seems to be a valid error
But how did zx/globals
become zx/globals.cjs
? Where was the ext attached? Could you provide a full demo ref/example?
@antongolub upgrade to 8.1.4 (and even 8.1.3) fixed the issue, sorry for bothering
(seems I updated wrong package.json to 8.1.4 during my tests)
8.1.2 produced that output
I have a build step that transpiles code for nodejs into cjs format to use it in github actions.
as a build tool I use esbuild like
it works fine until the moment I need to export a fucntion from
index.ts
- I see the next errormay it be a problem with
exports
configuration?in GitHub actions I use it inside the
github-actions/scripts
sectionwhere
release/dist
is a folder from esbuild step.it may be a wrong configuration though