diff --git a/packages/svelte2tsx/rollup.config.test.js b/packages/svelte2tsx/rollup.config.test.js index 2da91e0a5..71040a212 100644 --- a/packages/svelte2tsx/rollup.config.test.js +++ b/packages/svelte2tsx/rollup.config.test.js @@ -4,6 +4,17 @@ import resolve from '@rollup/plugin-node-resolve'; import json from '@rollup/plugin-json'; import del from 'rollup-plugin-delete'; import builtins from 'builtin-modules'; +import fs from 'fs'; + +function generateFile(file, x) { + return { + writeBundle() { + if (!process.env.CI) { + fs.writeFileSync(file, x); + } + } + }; +} export default [ { @@ -18,7 +29,8 @@ export default [ resolve({ browser: false, preferBuiltins: true }), commonjs(), json(), - typescript({ include: ['src/**/*'] }) + typescript({ include: ['src/**/*'] }), + generateFile('test/build/index.d.ts', "export { default } from '../../index';") ], external: [...builtins, 'typescript', 'svelte', 'svelte/compiler', 'magic-string'] }, @@ -34,7 +46,11 @@ export default [ resolve({ browser: false, preferBuiltins: true }), commonjs(), json(), - typescript({ include: ['src/**/*'] }) + typescript({ include: ['src/**/*'] }), + generateFile( + 'test/build/htmlxtojsx.d.ts', + "export * from '../../src/htmlxtojsx/index';" + ) ], external: [...builtins, 'typescript', 'svelte', 'svelte/compiler', 'magic-string'] }