diff --git a/scripts/build-success.sh b/scripts/build-success.sh index 75371b0..e9f7ae6 100644 --- a/scripts/build-success.sh +++ b/scripts/build-success.sh @@ -7,3 +7,7 @@ echo '{"type":"module"}' > dist/esm/package.json cp dist/index.js dist/backup-index.js cp dist/index.d.ts dist/backup-index.d.ts cp dist/esm/index.js dist/esm/backup-index.js + +echo '\n// backup' >> dist/backup-index.js +echo '\n// backup' >> dist/esm/backup-index.js +echo '\n// backup' >> dist/backup-index.d.ts diff --git a/test/lib/rebuild-dist.test.ts b/test/lib/rebuild-dist.test.ts index 0ffb13b..1967027 100644 --- a/test/lib/rebuild-dist.test.ts +++ b/test/lib/rebuild-dist.test.ts @@ -61,7 +61,9 @@ test('内容写入文件', async () => { foo, aaaaa }); - //# sourceMappingURL=index.js.map" + //# sourceMappingURL=index.js.map + // backup + " `); await expect(readFile(path.join(distDir, 'index.d.ts'), 'utf8')).resolves @@ -72,6 +74,8 @@ test('内容写入文件', async () => { export { aaaaa }; + // backup + declare const foo = { bar: "baz" }; export { foo };" `); @@ -84,6 +88,8 @@ test('内容写入文件', async () => { aaaaa }; //# sourceMappingURL=index.js.map + // backup + var foo = { bar: "baz" } export { foo };" `);