ant-design/scripts/generate-version.js
偏右 d221458939
refactor: 📦 Generate version.js from package.json (#23957)
* 📦 generate version.js from package.json

* components/version/version.ts

* remove version.js

* fix scripts

* Add pretest and predist

* clean up finalizeCompile

* fix lint
2020-05-08 17:49:22 +08:00

11 lines
246 B
JavaScript

const fs = require('fs-extra');
const path = require('path');
const { version } = require('../package.json');
fs.writeFileSync(
path.join(__dirname, '..', 'components', 'version', 'version.tsx'),
`export default '${version}'`,
'utf8',
);