diff options
author | 2022-03-08 17:11:18 -0500 | |
---|---|---|
committer | 2022-03-08 17:11:18 -0500 | |
commit | 0ae96bb7491a60eb2032bab23377ca54951a67a7 (patch) | |
tree | 22c80262da5ba59b4f2360f7800e51315e685fb8 /scripts/cmd/build.js | |
parent | 6bf124fb2f8ffd3909148ccc0e253c1f72f364cb (diff) | |
download | astro-0ae96bb7491a60eb2032bab23377ca54951a67a7.tar.gz astro-0ae96bb7491a60eb2032bab23377ca54951a67a7.tar.zst astro-0ae96bb7491a60eb2032bab23377ca54951a67a7.zip |
Fix/2177/log missing local network ip (#2732)
* feat: show "localhost" for local network IPs
* refactor: remove timestamps from addr logs
* fix: hide timestamp on null types
* feat: add emoji OS helper
* feat: make logs 100% nicer
* refactor: extract isLocalHost to util
* feat: update preview logs to match
* chore: add changeset
* fix: pull pkg version from package.json
* refactor: remove 👉 guys
* fix: devStart return type
* feat: inject process.env.PACKAGE_VERSION at build time
* feat: update unit test for hostname checks
Co-authored-by: Nate Moore <nate@skypack.dev>
Diffstat (limited to 'scripts/cmd/build.js')
-rw-r--r-- | scripts/cmd/build.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index b5eb91195..02c0f5798 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -28,7 +28,9 @@ export default async function build(...args) { .map((f) => f.replace(/^'/, '').replace(/'$/, '')); // Needed for Windows: glob strings contain surrounding string chars??? remove these let entryPoints = [].concat(...(await Promise.all(patterns.map((pattern) => glob(pattern, { filesOnly: true, absolute: true }))))); - const { type = 'module', dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString())); + const { type = 'module', version, dependencies = {} } = await fs.readFile('./package.json').then((res) => JSON.parse(res.toString())); + // expose PACKAGE_VERSION on process.env for CLI utils + config.define = { 'process.env.PACKAGE_VERSION': JSON.stringify(version) }; const format = type === 'module' ? 'esm' : 'cjs'; const outdir = 'dist'; await clean(outdir); |