Repository navigation
Replies: 1 comment
|
Yes—these two flags can work together with For the CJS output shown in your question, this minimal example works with the versions below: npm install --save-dev rollup@4.66.0 @rollup/plugin-typescript@12.3.1 typescript@5.9.3 tslib@2.8.1 @rollup/plugin-node-resolve@16.0.3// src/tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"declaration": true,
"isolatedDeclarations": true,
"outDir": "../lib/cjs",
"declarationDir": "../lib/cjs/types",
"noEmitOnError": true
},
"include": ["./*.ts"]
}// src/index.ts
export function twice(value: number): number {
return value * 2;
}Keep your Two different failures are worth distinguishing:
I verified the positive build, generated declaration, runtime result, and both negative cases with Rollup 4.66.0, Without the original diagnostic and References: TypeScript isolatedDeclarations, plugin configuration. |
Uh oh!
There was an error while loading. Please reload this page.
Is there a way to use
"declaration": trueand"isolatedDeclarations":truewith rollup?Currently I'm getting an issue with
@rollup/plugin-typescriptwhen trying to use such configuration with an ESM dual package libraryEverything works if I disable
"declaration": trueand"isolatedDeclarations":truebut I would like to futureproof the library in questionAll reactions