feat: 模板使用新build.js编译

This commit is contained in:
Pan Qiancheng 2026-01-04 16:59:25 +08:00
parent fb727c6b3c
commit 13384ab772
3 changed files with 24 additions and 6 deletions

View File

@ -85,7 +85,7 @@ function packageJsonContent({ name, version, description, cliName, cliBinName, i
"build-analyze:mp:staging": "${cliBinName} build --target mp --mode staging --analyze", "build-analyze:mp:staging": "${cliBinName} build --target mp --mode staging --analyze",
"build:mp": "${cliBinName} build --target mp --mode production", "build:mp": "${cliBinName} build --target mp --mode production",
"build-analyze:mp": "${cliBinName} build --target mp --mode production --analyze", "build-analyze:mp": "${cliBinName} build --target mp --mode production --analyze",
"build:watch": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json && npm run server:start:watch", "build:watch": "node --stack-size=4096 ./scripts/build.js -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json && npm run server:start:watch",
"start:web": "${cliBinName} start --target web --mode development --devMode frontend", "start:web": "${cliBinName} start --target web --mode development --devMode frontend",
"start:web:server": "${cliBinName} start --target web --mode development", "start:web:server": "${cliBinName} start --target web --mode development",
"start:native": "${cliBinName} start --target rn --mode development --devMode frontend", "start:native": "${cliBinName} start --target rn --mode development --devMode frontend",
@ -97,7 +97,7 @@ function packageJsonContent({ name, version, description, cliName, cliBinName, i
"build-sourcemap:web": "${cliBinName} build --target web --mode production --sourcemap", "build-sourcemap:web": "${cliBinName} build --target web --mode production --sourcemap",
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze", "build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
"build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze", "build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze",
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json", "build": "node --stack-size=4096 ./scripts/build.js -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json",
"prebuild": "npm run make:locale", "prebuild": "npm run make:locale",
"run:ios": "oak-cli run -p ios", "run:ios": "oak-cli run -p ios",
"run:android": "oak-cli run -p android", "run:android": "oak-cli run -p android",
@ -397,7 +397,13 @@ function tsConfigBuildJsonContent() {
"test", "test",
"src/pages/**/*", "src/pages/**/*",
"src/components/**/*" "src/components/**/*"
] ],
"oakBuildChecks": {
"context": {
"checkAsyncContext": true,
"targetModules": ["context/BackendRuntimeContext"]
}
}
}`; }`;
} }
function tsConfigPathsJsonContent(deps) { function tsConfigPathsJsonContent(deps) {

View File

@ -92,7 +92,7 @@ export function packageJsonContent({
"build-analyze:mp:staging": "${cliBinName} build --target mp --mode staging --analyze", "build-analyze:mp:staging": "${cliBinName} build --target mp --mode staging --analyze",
"build:mp": "${cliBinName} build --target mp --mode production", "build:mp": "${cliBinName} build --target mp --mode production",
"build-analyze:mp": "${cliBinName} build --target mp --mode production --analyze", "build-analyze:mp": "${cliBinName} build --target mp --mode production --analyze",
"build:watch": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json && npm run server:start:watch", "build:watch": "node --stack-size=4096 ./scripts/build.js -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json && npm run server:start:watch",
"start:web": "${cliBinName} start --target web --mode development --devMode frontend", "start:web": "${cliBinName} start --target web --mode development --devMode frontend",
"start:web:server": "${cliBinName} start --target web --mode development", "start:web:server": "${cliBinName} start --target web --mode development",
"start:native": "${cliBinName} start --target rn --mode development --devMode frontend", "start:native": "${cliBinName} start --target rn --mode development --devMode frontend",
@ -104,7 +104,7 @@ export function packageJsonContent({
"build-sourcemap:web": "${cliBinName} build --target web --mode production --sourcemap", "build-sourcemap:web": "${cliBinName} build --target web --mode production --sourcemap",
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze", "build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
"build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze", "build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze",
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json", "build": "node --stack-size=4096 ./scripts/build.js -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run copy-config-json",
"prebuild": "npm run make:locale", "prebuild": "npm run make:locale",
"run:ios": "oak-cli run -p ios", "run:ios": "oak-cli run -p ios",
"run:android": "oak-cli run -p android", "run:android": "oak-cli run -p android",
@ -406,7 +406,13 @@ export function tsConfigBuildJsonContent() {
"test", "test",
"src/pages/**/*", "src/pages/**/*",
"src/components/**/*" "src/components/**/*"
] ],
"oakBuildChecks": {
"context": {
"checkAsyncContext": true,
"targetModules": ["context/BackendRuntimeContext"]
}
}
}`; }`;
} }

View File

@ -0,0 +1,6 @@
/* eslint-disable @typescript-eslint/no-require-imports */
const { build } = require('oak-domain/lib/compiler/tscBuilder.js')
const pwd = process.cwd();
build(pwd, process.argv);