mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
[wasm] feat: expose library version
This commit is contained in:
@@ -2,6 +2,9 @@ import { defineConfig } from 'rollup';
|
||||
import { wasm } from '@rollup/plugin-wasm';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import { dts } from 'rollup-plugin-dts';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const pkgJson = JSON.parse(readFileSync(new URL('package.json', import.meta.url), 'utf-8'));
|
||||
|
||||
function makePlugins({ sync }) {
|
||||
const plugins = [];
|
||||
@@ -16,6 +19,7 @@ function makePlugins({ sync }) {
|
||||
preventAssignment: true,
|
||||
values: {
|
||||
'process.env.UMC_INLINE_BUILD': JSON.stringify(String(sync ? 1 : 0)),
|
||||
'process.env.UMC_VERSION': JSON.stringify(pkgJson.version),
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user