Skip to content

Commit

Permalink
fix build cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
springuper committed Nov 30, 2022
1 parent ace8d80 commit 206442c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"files": [
"dist"
],
"version": "6.6.2-beta.13",
"version": "6.6.2-beta.14",
"description": "Lightweight fuzzy-search",
"license": "Apache-2.0",
"repository": {
Expand All @@ -31,7 +31,7 @@
"dev": "rollup -w -c scripts/configs.js --environment TARGET:umd-dev-full",
"dev:cjs": "rollup -w -c scripts/configs.js --environment TARGET:commonjs-full",
"dev:esm": "rollup -w -c scripts/configs.js --environment TARGET:esm-dev-full",
"build": "rm -r dist && mkdir dist && node ./scripts/build.main.js",
"build": "node ./scripts/build.main.js",
"test": "jest",
"lint": "eslint src scripts test",
"release": "./scripts/release.sh",
Expand Down
7 changes: 5 additions & 2 deletions scripts/build.main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ const terser = require('terser')
const rollup = require('rollup')
const configs = require('./configs')

if (!fs.existsSync('dist')) {
fs.mkdirSync('dist')
const DIST_DIR = 'dist'

if (fs.existsSync(DIST_DIR)) {
fs.rmSync(DIST_DIR, { recursive: true })
}
fs.mkdirSync(DIST_DIR)

build(Object.keys(configs).map((key) => configs[key]))

Expand Down

0 comments on commit 206442c

Please sign in to comment.