storybook/lib/api/scripts/generateVersion.js
Norbert de Langen 341fc2d90d
FIX linting
2020-03-27 20:04:50 +01:00

10 lines
330 B
JavaScript

const fs = require('fs');
const path = require('path');
const output = (version) => `export const version = '${version}';\n`;
const text = fs.readFileSync(path.join(__dirname, '../package.json'), 'utf8');
const json = JSON.parse(text);
fs.writeFileSync(path.join(__dirname, '../src/version.ts'), output(json.version), 'utf8');