mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
add scripts/pkgfile.js
Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
parent
bbbdd1a881
commit
259988f230
24
scripts/pkgfile.js
Normal file
24
scripts/pkgfile.js
Normal file
@ -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));
|
||||||
Loading…
x
Reference in New Issue
Block a user