chore: reduce postinstall build content and improve rush update speed

This commit is contained in:
kkxxkk2019 2023-08-21 22:25:05 +08:00 committed by Howard Zhang
parent a7df058538
commit 4766f8722d
6 changed files with 11 additions and 9 deletions

View File

@ -18918,8 +18918,8 @@ packages:
engines: {node: '>= 0.8'}
dev: true
/std-env/3.4.1:
resolution: {integrity: sha512-8ff1ZsX3NZMNEmDZmINWcFb7CIhPGKZO+TSVytJxJmFzZjAHtAHOR2GuIur7QXlgwY9Md7wNlu4Q7TtSvbu/SA==}
/std-env/3.4.2:
resolution: {integrity: sha512-Cw6eJDX9AxEEL0g5pYj8Zx9KXtDf60rxwS2ze0HBanS0aKhj1sBlzcsmg+R0qYy8byFa854/yR2X5ZmBSClVmg==}
dev: true
/stealthy-require/1.1.1:
@ -21004,7 +21004,7 @@ packages:
pathe: 1.1.1
picocolors: 1.0.0
source-map: 0.6.1
std-env: 3.4.1
std-env: 3.4.2
strip-literal: 1.3.0
tinybench: 2.5.0
tinypool: 0.4.0

View File

@ -1,6 +1,3 @@
/**
* @type {import('@internal/bundler').Config}
*/
const fs = require('fs');
const path = require('path');
@ -19,6 +16,9 @@ function copyStart(source, destinations) {
});
}
/**
* @type {import('@internal/bundler').Config}
*/
module.exports = {
name: 'VChart',
formats: ['es', 'cjs', 'umd'],

View File

@ -26,7 +26,7 @@
"test-live": "npm run test-watch __tests__/unit/",
"test-watch": "DEBUG_MODE=1 jest --watch",
"ci": "ts-node --transpileOnly --skipProject ./scripts/trigger-test.ts",
"postinstall": "npm run build"
"postinstall": "bundle --clean -f es --ignorePostTasks"
},
"files": [
"esm",

View File

@ -27,6 +27,7 @@ bundle -f es -w dev --env __DEV__=true --env __ID__="'my_id'"
--minify 是否输出压缩后的 UMD 产物文件
-w, --watch 监听文件变化重新构建
-s, --sourcemap 是否生成 sourcemap
--ignorePostTasks, 不执行 postTasks
```
# 配置文件

View File

@ -132,7 +132,8 @@ async function bootstrap() {
_task(Tasks.COPY_FILES, () => copyFiles(PROJECT_ROOT, config));
taskList.push(Tasks.COPY_FILES);
}
if (config.postTasks) {
if (!args.ignorePostTasks && config.postTasks) {
const tasksKey = Object.keys(config.postTasks);
if (tasksKey.length) {
tasksKey.forEach(name => {

View File

@ -47,7 +47,7 @@ export function parserCLIArgs(argv: string | string[]): Partial<CLIArgs> {
},
array: ['formats', 'envs', 'copy'],
string: ['config'],
boolean: ['watch', 'less', 'clean', 'minify', 'sourcemap'],
boolean: ['watch', 'less', 'clean', 'minify', 'sourcemap', 'ignorePostTasks'],
coerce: getCoerce(stringKeys)
});
}