mirror of
https://github.com/aurelienstebe/Gladdis.git
synced 2026-07-22 08:40:27 +00:00
- add a "live" ESbuild and "prod" Rollup configs to bundle the "main.js" - add "manifest.json" and version-bump script, adapt the "package.json"
17 lines
718 B
JavaScript
Executable file
17 lines
718 B
JavaScript
Executable file
import fs from 'fs-extra'
|
|
import process from 'process'
|
|
|
|
const targetVersion = process.argv[2] ?? process.env.npm_package_version
|
|
|
|
// read minAppVersion from manifest.json and bump version to target version
|
|
const manifest = JSON.parse(fs.readFileSync('manifest.json', 'utf-8'))
|
|
const { minAppVersion } = manifest
|
|
manifest.version = targetVersion
|
|
fs.writeFileSync('manifest.json', JSON.stringify(manifest, null, ' ') + '\n')
|
|
|
|
// update versions.json with target version and minAppVersion from manifest.json
|
|
const versions = JSON.parse(fs.readFileSync('versions.json', 'utf-8'))
|
|
versions[targetVersion] = minAppVersion
|
|
fs.writeFileSync('versions.json', JSON.stringify(versions, null, ' ') + '\n')
|
|
|
|
process.exit(0)
|