Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Svelte and .d.ts generation with rollup

$
0
0

I am trying to bundle with rollup a library written in svelte/ts. My purpose is of course to produce a .js (several for es/umd/...) and a .d.ts file.

As an input (source-code) I have :

  • .ts files
  • .svelte files (using <script lang="ts"> tag)
  • .d.ts files

I tried several .d.ts bundler but all fail at a moment. I tried using them as plugins in my main rollup configuration, to use it in a separate configuration or even as a second command beside rollup, annexed some examples (not exhaustive).

Does anyone already had this bundling successfully done ?

nothing

Just using no plugin but specifying "declaration": true in tsconfig.json will not raise any error but create a .d.ts who

  • does not contain the declarations from my source .d.ts
  • produce some export { something } from "./my-source.svelte"; in the output folder who contains only the produced .js file.

svelte-dts

Raises an exception because, when analysing the .d.ts file, the declaration property of the file analysis is .... undefined

rollup-plugin-dts

Will raise an Export '...' is not defined (Note that you need plugins to import files that are not JavaScript) on a export class ...

dts-bundle-generator

Trying to run dts-bundle-generator as a separate command: I couldn't find a way for it to take into consideration my source .d.ts files, so it complains about undefined types


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>