Skip to content

Commit

Permalink
(chore) Generate dts for test build (#867)
Browse files Browse the repository at this point in the history
for svelte2tsx
  • Loading branch information
pushkine authored Mar 9, 2021
1 parent e79ee80 commit 60e976e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/svelte2tsx/rollup.config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
{
Expand All @@ -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']
},
Expand All @@ -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']
}
Expand Down

0 comments on commit 60e976e

Please sign in to comment.