Skip to content

Commit

Permalink
build: switched package.json import method during build to cover supp…
Browse files Browse the repository at this point in the history
…orted node versions
  • Loading branch information
erik-perri committed Jul 16, 2024
1 parent 636376b commit abb6ef0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { createRequire } from 'node:module';

import { build } from 'esbuild';

import data from './package.json' assert { type: 'json' };
const require = createRequire(import.meta.url);
const { version } = require('./package.json');

const banners = [
'#!/usr/bin/env node',
`process.env.APP_VERSION = ${JSON.stringify(data.version)};`,
`process.env.APP_VERSION = ${JSON.stringify(version)};`,
];

const config = {
Expand Down

0 comments on commit abb6ef0

Please sign in to comment.