-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove "type" key from package.json
- Loading branch information
Showing
2 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
"private": false, | ||
"version": "0.0.31", | ||
"packageManager": "[email protected]", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
|
@@ -51,7 +50,8 @@ | |
"storybook": "storybook dev -p 6006", | ||
"build-storybook": "storybook build", | ||
"icongen": "svgr --out-dir ./src/icon/generated-default --index-template ./tools/svgrIndexTemplate.cjs -- ./src/icon/assets", | ||
"prepare": "husky && panda codegen" | ||
"prepare": "husky && panda codegen", | ||
"prepublishOnly": "node tools/removePacakgeType.cjs" | ||
}, | ||
"dependencies": { | ||
"date-fns": "3.3.1", | ||
|
@@ -117,4 +117,4 @@ | |
"eslint --fix" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* eslint-disable no-undef */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const packagePath = path.resolve(__dirname, '..', 'package.json'); | ||
|
||
fs.readFile(packagePath, 'utf8', (err, data) => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
|
||
const packageJson = JSON.parse(data); | ||
delete packageJson.type; | ||
|
||
fs.writeFile(packagePath, JSON.stringify(packageJson, null, 2), 'utf8', err => { | ||
if (err) { | ||
console.error(err); | ||
return; | ||
} | ||
console.log('The "type" key has been removed from the package.json file.'); | ||
}); | ||
}); |