From f1ce15fac2eac82b628727ee44e23842939ec139 Mon Sep 17 00:00:00 2001 From: geekact Date: Mon, 7 Oct 2024 14:36:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20pnpm=E5=AE=89=E8=A3=85=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E6=96=87=E4=BB=B6=E4=BC=9A=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=90=8C=E4=B8=80=E4=B8=AAinode=E5=8F=98=E6=88=90?= =?UTF-8?q?=E7=A1=AC=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build-success.sh | 4 ++++ test/lib/rebuild-dist.test.ts | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 };" `);