fix: shared exporta dist compilado, no src TS (arregla crash de la API en prod)
El package apuntaba main/types a src/index.ts. En runtime Node intentaba cargar TypeScript desde node_modules y abortaba con ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING, dejando la API en 502. Surgió al importar CONFIGURABLE_SCENARIOS (valor real, no solo tipos). main/types → dist, exports con condición development→src para hot-reload, files:["dist"] para que pnpm deploy nunca copie el .ts. El frontend no se ve afectado: Vite resuelve shared vía alias a src/ en su config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,18 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./src/index.ts",
|
"main": "./dist/index.js",
|
||||||
"types": "./src/index.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
|
"development": "./src/index.ts",
|
||||||
|
"default": "./dist/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
|
|||||||
Reference in New Issue
Block a user