-
-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to tell --configPlugin
to use specific tsconfig
?
#1713
Comments
From the docs https://rollupjs.org/command-line-interface/#configplugin-plugin:
This last part is how you can specify such options while the options for the TypeScript plugin can be found here https:/rollup/plugins/blob/master/packages/typescript/README.md#tsconfig |
I saw that and I did try this (sorry, should have specified in the OP): rollup -c rollup-lambdas.config.ts --configPlugin "typescript={tsconfig:'tsconfig-lambdas.json'}" --bundleConfigAsCjs This gives me:
It does seem like documentation is lacking for the plugin-args feature (and I can't get it to work). |
I find that using Typescript Rollup config files can be challenging and frustrating if you need to use different Typescript config options for your main source code. By the way, Rollup doesn't follow standard Typescript behavior when resolving With that, the way I was able to make it work is: Create basic Use In your import rollupTypescript from "@rollup/plugin-typescript";
import type { RollupOptions } from "rollup";
const config: RollupOptions = {
...
plugins: [
rollupTypescript({
// Source tsconfig
tsconfig: "tsconfig.json"
}),
],
}
export default config; I hope this will be addressed sometime to make using Typescript config in Rollup less cumbersome or at least documented more clearly. |
Thanks, I'll give it a try. |
For anyone else who was struggling with the workaround in #1713 (comment), I needed to escape the quotes (it looks like the yargsparser used by rollup strips quotation marks):
|
Documentation Is:
Please Explain in Detail...
I am getting the error:
I am running:
It appears that the plugin is using my
tsconfig.json
instead oftsconfig-lambdas.json
. I added logging to@rollup/plugin-typescript/dist/cjs/index.js:423
(console.log(compilerOptions)
) and I get this output:{ // ... configFilePath: '/home/josh/.../tsconfig.json', }
To get around this I renamed the original
tsconfig.json
totsconfig-main.json
andtsconfig-lambdas.json
totsconfig.json
, now the plugin uses the "correct" (default) tsconfig and my build works.How can I tell the plugin to use my other
tsconfig
?Your Proposal for Changes
Not sure.
The text was updated successfully, but these errors were encountered: