imagine there is a monorepo, the structure is below:
the server app uses the tsconfig.json file that will extends the local package named "tsconfig" inside packages folder.
the code inside tsconfig.json file of server likes below:
{
"extends": tsconfig/base.json
}
the package.json of server :
"devDependencies": {
"tsconfig": "workspace:*"
}
and then, I use the logger package in the server app with import logger from '@jeditor/logger'
,
by now ,everything is Ok, but when I use tsup to bundle my server app, it got an error shows "could not resolve @jeditor/logger"γ
the base.json likes below:
"baseUrl": "../../",
"paths": {
"@jeditor/*": ["packages/*/src"]
}
the baseUrl will point to monorepo root.
the tsup.config.ts likes below:
entry: ['src'],
splitting: true,
clean: true,
format: ['cjs'],
platform: 'node',
tsconfig: 'tsconfig.build.json',
bundle: true,
noExternal:["@jeditor/logger"],
dts: process.env.NODE_ENV === 'production' ? false : true,
sourcemap: process.env.NODE_ENV === 'production' ? false : true,
minify: process.env.NODE_ENV === 'production' ? 'terser' : false,
terserOptions: {
compress: true,
keep_classnames: false,
keep_fnames: false,
mangle: true,
sourceMap: false,
}
question: can tsup resolve the tsconfig that is the local pkg inside the monorepo? if tsup can resolved it, can tsup recognize the paths alias in the tsconfig/base.json?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too