Skip to content
Discussion options

You must be logged in to vote

Yes. Use noForceEmit: true together with TypeScript's declaration: true and emitDeclarationOnly: true, then let Sucrase handle the JavaScript transform:

import typescript from '@rollup/plugin-typescript';
import sucrase from '@rollup/plugin-sucrase';

export default {
  input: 'src/index.ts',
  output: { dir: 'dist', format: 'es' },
  plugins: [
    typescript({ tsconfig: './tsconfig.json', noForceEmit: true }),
    sucrase({ transforms: ['typescript'] }),
  ],
};
{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "strict": true,
    "declaration": true,
    "emitDeclarationOnly": true,
    "declarationDir": "dist/types",
    "r…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@StreetStrider
Comment options

Answer selected by StreetStrider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants