Introduction
Hello there ! first of all thanks for the great work, using preconstruct was very smooth and helped me a lot to understand multi-entrypoint import both in esm/cjs
Related PR #618
The issue
Right now unless I'm mistaken, will only be computed the package/tsconfig.json.
This could be a bottleneck when working with composite TypeScript projects ( aka solution style TypeScript configuration ) or when having a dedicated tsconfig json file for build etc.
// tsconfig.json
{
// ...
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
Actual
In this way, from my understanding of the preconstruct the current "stick to tsconfig.json" behavior is implied by the
// cli/src/rollup-plugins/typescript-declarations/common.ts
export async function getProgram(dirname: string, pkgName: string, ts: TS) {
let configFileName = ts.findConfigFile(dirname, ts.sys.fileExists);
Which has this signature
function findConfigFile(searchPath, fileExists, configName = "tsconfig.json") {
Suggestion
Adding a new configuration option tsConfigFilename under a typescript configuration object in Preconstruct's config:
{
"preconstruct": {
"typescript": {
"tsConfigFilename": "tsconfig.build.json"
}
}
}
Related pull-request
Created this #618 in order to give more context and consistency to this issue
Tests might not be the most idiomatic and such could also be the configuration naming 😅 let me know !
As always any suggestions are welcomed !
Have a great day !
Introduction
Hello there ! first of all thanks for the great work, using
preconstructwas very smooth and helped me a lot to understand multi-entrypoint import both inesm/cjsRelated PR #618
The issue
Right now unless I'm mistaken, will only be computed the
package/tsconfig.json.This could be a bottleneck when working with composite TypeScript projects ( aka solution style TypeScript configuration ) or when having a dedicated
tsconfigjson file for build etc.Actual
In this way, from my understanding of the
preconstructthe current "stick to tsconfig.json" behavior is implied by theWhich has this signature
Suggestion
Adding a new configuration option
tsConfigFilenameunder atypescriptconfiguration object in Preconstruct's config:{ "preconstruct": { "typescript": { "tsConfigFilename": "tsconfig.build.json" } } }Related pull-request
Created this #618 in order to give more context and consistency to this issue
Tests might not be the most idiomatic and such could also be the configuration naming 😅 let me know !
As always any suggestions are welcomed !
Have a great day !