Skip to content

Commit

Permalink
feat(ses): add SES version
Browse files Browse the repository at this point in the history
Tested
- `npm run build`
- `head dist/ses.cjs`
  • Loading branch information
leotm committed Nov 8, 2023
1 parent d5646cb commit 4a9dfae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ses/scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import fs from 'fs';
import { makeBundle } from '@endo/compartment-mapper/bundle.js';
import { minify } from 'terser';
import { fileURLToPath, pathToFileURL } from 'url';
import packageJson from '../package.json' assert { type: 'json' };

const resolve = (rel, abs) => fileURLToPath(new URL(rel, abs).toString());
const root = new URL('..', import.meta.url).toString();
Expand All @@ -15,10 +16,11 @@ const write = async (target, content) => {
};

const main = async () => {
const bundle = await makeBundle(
const version = packageJson.version;
const bundle = `// v${version}\n${await makeBundle(
read,
pathToFileURL(resolve('../index.js', import.meta.url)).toString(),
);
)}`;
const { code: terse } = await minify(bundle, {
mangle: false,
keep_classnames: true,
Expand Down

0 comments on commit 4a9dfae

Please sign in to comment.