Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Apr 4, 2024
1 parent 7c19fd8 commit 825a1a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rollup.config.mjs
@@ -1,6 +1,7 @@
import nodeResolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import fs from 'node:fs';
import path from 'node:path';

const plugins = [
nodeResolve(),
Expand All @@ -16,9 +17,10 @@ export default [
...plugins,
{
name: 'copy-typescript-files',
generateBundle() {
fs.copyFileSync('src/index.d.ts', 'dist/magic-string.es.d.mts');
fs.copyFileSync('src/index.d.ts', 'dist/magic-string.cjs.d.ts');
closeBundle() {
const base = path.resolve('./src/index.d.ts');
fs.copyFileSync(base, path.resolve('./dist/magic-string.es.d.mts'));
fs.copyFileSync(base, path.resolve('./dist/magic-string.cjs.d.ts'));
}
}
],
Expand Down

0 comments on commit 825a1a1

Please sign in to comment.