Skip to content

Commit

Permalink
尝试回退package.json的导出样式
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Shan committed Oct 10, 2023
1 parent 0d96dd5 commit 17a5f51
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -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);
Expand Down

0 comments on commit 17a5f51

Please # to comment.