-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9982ac3
commit 6234c2f
Showing
3 changed files
with
42 additions
and
26 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
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 |
---|---|---|
@@ -1,27 +1,7 @@ | ||
import esbuild from 'esbuild'; | ||
import { readFile, writeFile } from 'fs/promises'; | ||
import { resolve } from 'path'; | ||
import { config, target } from './config.mjs'; | ||
|
||
async function normalizeManifest() { | ||
const cwd = process.cwd(); | ||
const packageJsonPath = resolve(cwd, 'package.json'); | ||
const packageJsonContent = await readFile(packageJsonPath, 'utf8'); | ||
const { version } = JSON.parse(packageJsonContent); | ||
const manifestPath = `${target}/manifest.json`; | ||
const manifestContent = await readFile(manifestPath, 'utf8'); | ||
const manifest = JSON.parse(manifestContent); | ||
|
||
if (manifest.version !== version) { | ||
manifest.version = version; | ||
const newContent = JSON.stringify(manifest, undefined, 2); | ||
await writeFile(manifestPath, newContent, 'utf8'); | ||
} | ||
} | ||
import { config } from './config.mjs'; | ||
|
||
await esbuild.build({ | ||
...config, | ||
sourcemap: false, | ||
}); | ||
|
||
await normalizeManifest(); |
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