From 4321bac3bf34ec3fa387de86ece34eb12859b918 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 22 Dec 2024 23:00:43 +0800 Subject: [PATCH] fix: ignore egg properties --- README.md | 4 ---- src/index.ts | 2 -- test/index.test.ts | 10 ---------- 3 files changed, 16 deletions(-) diff --git a/README.md b/README.md index 5e3325c..1b50018 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,6 @@ export function getDirname() { } ``` -## Auto copy egg meta properties package.json - -Copy `eggPlugin`, `egg` to `dist/package.json` - ## License [MIT](LICENSE) diff --git a/src/index.ts b/src/index.ts index 3270c07..0161bf9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,8 +13,6 @@ writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n') writeFileSync('dist/package.json', JSON.stringify({ name: pkg.name, version: pkg.version, - eggPlugin: pkg.eggPlugin, - egg: pkg.egg, }, null, 2) + '\n') // Replace all `( import.meta.url )` into `('import_meta_url_placeholder_by_tshy_after')` on commonjs. diff --git a/test/index.test.ts b/test/index.test.ts index a9bf9ad..8c3a6e3 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -57,15 +57,5 @@ describe('test/index.test.ts', () => { const distPkg = JSON.parse(fs.readFileSync(distPackageFile, 'utf-8')); assert.equal(distPkg.name, 'tshy-after'); assert.equal(distPkg.version, '1.0.0'); - assert.deepEqual(distPkg.eggPlugin, { - "name": "egg-mock", - "exports": { - "import": "./dist/esm", - "require": "./dist/commonjs" - }, - }); - assert.deepEqual(distPkg.egg, { - framework: true, - }); }); });