Skip to content

Commit

Permalink
add scripts/pkgfile.js
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <[email protected]>
  • Loading branch information
a110605 committed Jan 6, 2025
1 parent bbbdd1a commit 259988f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/pkgfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const fs = require('fs');

console.log('Updating package file'); // eslint-disable-line no-console

if (process.argv.length !== 3) {
console.error('No enough args'); // eslint-disable-line no-console

return;
}

const pkgFilepath = process.argv[process.argv.length - 1];
const pkg = require(pkgFilepath);

// Ensure we have the keys we need

pkg.files = ['**/*'];
pkg.rancher = true;
pkg.main = `${ pkg.name }-${ pkg.version }.umd.min.js`;

delete pkg.scripts;
delete pkg.browserslist;


fs.writeFileSync(pkgFilepath, JSON.stringify(pkg, null, 2));

0 comments on commit 259988f

Please sign in to comment.