From 17a5f5197e29c2a2fa3da29e04f76bdc55f7f02d Mon Sep 17 00:00:00 2001 From: Yun Shan Date: Tue, 10 Oct 2023 15:23:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=9B=9E=E9=80=80package.jso?= =?UTF-8?q?n=E7=9A=84=E5=AF=BC=E5=87=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rollup.config.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index fbbb27f..5ee6579 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -35,10 +35,8 @@ export default defineConfig([ transform: (contents) => { const content = JSON.parse(contents.toString()); content.types = 'index.d.js'; - content.exports = { - import: './index.esm.js', - require: './index.js', - }; + content.main = 'index.js'; + content.module = 'index.esm.js'; content.repository = 'https://github.com/Enraged-Dun-Cookie-Development-Team/node-common'; const buildNumber = process.env.BUILD_NUMBER === 'dev' ? 'dev' : parseInt(process.env.BUILD_NUMBER || 'NaN'); if (!(buildNumber > 0) && buildNumber !== 'dev') { @@ -49,6 +47,7 @@ export default defineConfig([ throw `获取git hash失败:${hash}`; } content.version = `${content.version}-alpha.${buildNumber}+${hash}`; + delete content['type']; delete content['scripts']; delete content['lint-staged']; return JSON.stringify(content, null, 2);