build: update build version

This commit is contained in:
zazzaz 2020-11-22 21:34:02 +08:00
parent 7897fa1ba4
commit a84b72e8f1
4 changed files with 10 additions and 2 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ coverage/
website-dist
lib
website/play/index.vue
ep-version.js

6
build/gen-version.js Normal file
View File

@ -0,0 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs')
const path = require('path')
const { version } = require('../package.json')
fs.writeFileSync(path.resolve(__dirname, '../ep-version.js'), `export const version = '${version}'
`)

View File

@ -7,7 +7,8 @@
"test": "jest",
"gen": "bash ./scripts/gc.sh",
"bootstrap": "yarn && npx lerna bootstrap",
"build": "yarn bootstrap && yarn build:lib && yarn build:theme && yarn build:esm-bundle && yarn build:esm && yarn build:utils && yarn build:locale && yarn build:locale-umd",
"gen:version": "node build/gen-version.js",
"build": "yarn bootstrap && yarn gen:version && yarn build:lib && yarn build:theme && yarn build:esm-bundle && yarn build:esm && yarn build:utils && yarn build:locale && yarn build:locale-umd",
"build:lib": "rimraf lib && webpack --config ./build/webpack.config.js",
"build:esm-bundle": "rollup --config ./build/rollup.config.bundle.js",
"build:esm": "node ./build/bincomp.js",

View File

@ -83,7 +83,7 @@ import ElTransfer from '@element-plus/transfer'
import ElTree from '@element-plus/tree'
import ElUpload from '@element-plus/upload'
import { use } from '@element-plus/locale'
import { version } from '../../package.json'
import { version } from '../../ep-version'
interface InstallOptions {
size: ComponentSize