Skip to content

Commit 48eea2a

Browse files
ThanhDodeurOdooalexkuhn
authored andcommitted
[IMP] add the version to the bundle __info__
1 parent 8ee7660 commit 48eea2a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

rollup.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1+
import { readFileSync } from "node:fs";
2+
import { fileURLToPath } from "node:url";
3+
import { dirname, join } from "node:path";
4+
15
import resolve from "@rollup/plugin-node-resolve";
26
import commonjs from "@rollup/plugin-commonjs";
37
import typescript from "@rollup/plugin-typescript";
48
import license from "rollup-plugin-license";
59
import git from "git-rev-sync";
610

11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = dirname(__filename);
13+
14+
const packageJson = JSON.parse(readFileSync(join(__dirname, "package.json"), "utf-8"));
15+
716
const outro = `
817
export const __info__ = {
918
date: '${new Date().toISOString()}',
1019
hash: '${git.short()}',
1120
url: 'https://github.com/odoo/sfu',
21+
version: '${packageJson.version}',
1222
};
1323
`;
1424

0 commit comments

Comments
 (0)