vite-plugin-dts 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +326 -326
- package/README.zh-CN.md +325 -325
- package/dist/index.cjs +6 -2
- package/dist/index.mjs +6 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -594,6 +594,7 @@ function rollupDeclarationFiles({
|
|
|
594
594
|
|
|
595
595
|
const noneExport = "export {};\n";
|
|
596
596
|
const vueRE = /\.vue$/;
|
|
597
|
+
const svelteRE = /\.svelte$/;
|
|
597
598
|
const tsRE = /\.(m|c)?tsx?$/;
|
|
598
599
|
const jsRE = /\.(m|c)?jsx?$/;
|
|
599
600
|
const dtsRE = /\.d\.(m|c)?tsx?$/;
|
|
@@ -674,6 +675,9 @@ ${cyan(
|
|
|
674
675
|
}
|
|
675
676
|
} else if (!id.includes(".vue?vue") && (tsRE.test(id) || allowJs && jsRE.test(id))) {
|
|
676
677
|
project.createSourceFile(id, await fs.readFile(id, "utf-8"), { overwrite: true });
|
|
678
|
+
} else if (svelteRE.test(id)) {
|
|
679
|
+
const content = "export { SvelteComponentTyped as default } from 'svelte/internal';";
|
|
680
|
+
project.createSourceFile(`${id}.ts`, content, { overwrite: true });
|
|
677
681
|
}
|
|
678
682
|
}
|
|
679
683
|
return {
|
|
@@ -709,7 +713,7 @@ ${cyan(
|
|
|
709
713
|
`
|
|
710
714
|
${cyan(
|
|
711
715
|
"[vite:dts]"
|
|
712
|
-
)} You building
|
|
716
|
+
)} You are building a library that may not need to generate declaration files.
|
|
713
717
|
`
|
|
714
718
|
)
|
|
715
719
|
);
|
|
@@ -734,7 +738,7 @@ ${cyan(
|
|
|
734
738
|
`
|
|
735
739
|
${cyan(
|
|
736
740
|
"[vite:dts]"
|
|
737
|
-
)} Can not resolve declaration directory
|
|
741
|
+
)} Can not resolve declaration directory. Please check your vite config and plugin options.
|
|
738
742
|
`
|
|
739
743
|
)
|
|
740
744
|
);
|