[Feature]: Add override for `noEmit` specified in TSConfig
What problem does this feature solve?
When using Modern.js alongside @total-typescript/tsconfig, noEmit: false has to be specified explicitly within tsconfig.json, otherwise modern build fails:
error ModuleBuildError:
bundleless DTS failed:
error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'.
Unfortunately, though, when I have noEmit: false specified (either implicitly or explicitly) alongside allowJs: true, IDEs like VS Code show an error message as follows when viewing tsconfig.json while having any JS files within the source directory:
Cannot write file '…/project/src/something.js' because it would overwrite input file.
Therefore, it’d be convenient to allow specifying noEmit: true within the userTsconfig, possibly overriding it by appending --noEmit false to the CLI arguments over here.
What does the proposed API look like?
N/A
Could you provide the project? Because we don't know which tsconfig from @total-typescript/tsconfig you are using, and is app-tools or module-tools used in the project?
Thanks for your response!
Unfortunately, I can’t provide the project itself, as it’s a private one. This is the TSConfig I’m using.
Thanks for your response!
Unfortunately, I can’t provide the project itself, as it’s a private one. This is the TSConfig I’m using.
Understand, what library are you using? @modern-js/app-tools or @modern-js/module-tools?
@modern-js/module-tools, but I also gave Vite’s library mode a go in the meantime and sticked with it for the time being.
I created a project as described to try to reproduce the problem, but it didn't reproduce the problem.
Thanks for creating that!
I forgot to mention I had 'npm-component-es2017' configured as the buildPreset in modern.config.ts. Running your project with that change results in a reproduction.
Thanks for creating that!
I forgot to mention I had
'npm-component-es2017'configured as thebuildPresetinmodern.config.ts. Running your project with that change results in a reproduction.
Can't reproduce the error even adding 'npm-componnet-es2017', the error seems quite like a pure TypeScript misconfiguration, could you check your tsconfig by refering https://stackoverflow.com/a/48798945/8063488.