add prepublish script

This commit is contained in:
Jacob Overgaard
2023-05-26 16:31:53 +02:00
parent 0e3a8b902d
commit 1fbe5b75a0
2 changed files with 14 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
import { readFileSync, writeFileSync } from 'fs';
const packageFile = './package.json';
const packageJson = JSON.parse(readFileSync(packageFile, 'utf8'));
/**
* Here we will modify the package.json to remove dependencies that are not needed in the CMS or does not work on npm.
*/
delete packageJson.dependencies['router-slot'];
// Write the package.json back to disk
writeFileSync(packageFile, JSON.stringify(packageJson, null, 2), 'utf8');

View File

@@ -89,7 +89,8 @@
"wc-analyze:vscode": "wca **/*.element.ts --format vscode --outFile dist-cms/vscode-html-custom-data.json",
"new-extension": "plop --plopfile ./devops/plop/plop.js",
"compile": "tsc",
"check": "npm run lint && npm run compile && npm run build-storybook"
"check": "npm run lint && npm run compile && npm run build-storybook",
"prepublish": "node ./devops/publish/cleanse-pkg.js"
},
"engines": {
"node": ">=18.14 <19",