Open bcmRayCrazy-coder opened 1 year ago
Same issue. Building with nx
and @nrwl/esbuild:esbuild
@bcmRayCrazy-coder I think I realize.
You need to say to your bundler that this library in using local imports and it should be external
.
In esbuild
I have this option. Rollup have this option too, maybe it can help in your case.
My config for nx.dev
{
// ...
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/react-native-deploy",
"format": ["cjs"],
"main": "apps/react-native-deploy/src/main.ts",
"tsConfig": "apps/react-native-deploy/tsconfig.app.json",
"assets": [
"apps/react-native-deploy/src/assets"
],
// >>>>>>> this lines below for you
"external": [
"terminal-kit"
]
}
},
// ....
}
I am experiencing the same issue packaging terminal kit. I reached the same error after setting --external:terminal-kit in esbuild.
I just packed my code directly using pkg But I can't launch it, 艹 Error below: