sourcemap 打包命令

This commit is contained in:
Wang Kejun 2022-10-16 00:33:00 +08:00
parent e86bfc9de9
commit cfea366487
6 changed files with 14 additions and 4 deletions

View File

@ -19,6 +19,7 @@ async function build(cmd) {
`SUB_DIR_NAME=${cmd.subDir || 'wechatMp'}`,
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
`COMPILE_ANALYZE=${cmd.analyze}`,
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
`ts-node`,
require.resolve(`../scripts/${cmd.mode === 'production'
? 'build-mp.js'
@ -41,6 +42,7 @@ async function build(cmd) {
`SUB_DIR_NAME=${cmd.subDir || 'web'}`,
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
`COMPILE_ANALYZE=${cmd.analyze}`,
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
`ts-node`,
require.resolve(`../scripts/${cmd.mode === 'production'
? 'build-web.js'

View File

@ -46,6 +46,7 @@ commander_1.default
.action(make_1.default);
commander_1.default
.command('start')
.option('--sourceMap', 'sourceMap')
.option('--analyze', 'analyze')
.option('-t, --target <target>', 'target')
.option('-m, --mode <mode>', 'mode')
@ -55,6 +56,7 @@ commander_1.default
.action(build_1.default);
commander_1.default
.command('build')
.option('--sourcemap', 'sourcemap')
.option('--analyze', 'analyze')
.option('-t, --target <target>', 'target')
.option('-m, --mode <mode>', 'mode')

View File

@ -36,6 +36,7 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
"start:web": "${cliBinName} start --target web --mode development",
"build:web": "${cliBinName} build --target web --mode production",
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
"build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze",
"build": "tsc",
"server:init": ${serverInitScript},
"server:start": ${serverStartScript},
@ -64,9 +65,9 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"rmc-pull-to-refresh": "^1.0.13",
"tdesign-icons-react": "^0.1.4",
"tdesign-icons-react": "^0.1.6",
"tdesign-mobile-react": "^0.2.0",
"tdesign-react": "^0.40.5",
"tdesign-react": "^0.42.2",
"url": "^0.11.0",
"uuid": "^8.3.2"
},

View File

@ -31,6 +31,7 @@ export default async function build(cmd: any) {
`SUB_DIR_NAME=${cmd.subDir || 'wechatMp'}`,
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
`COMPILE_ANALYZE=${cmd.analyze}`,
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
`ts-node`,
require.resolve(
`../scripts/${
@ -59,6 +60,7 @@ export default async function build(cmd: any) {
`SUB_DIR_NAME=${cmd.subDir || 'web'}`,
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
`COMPILE_ANALYZE=${cmd.analyze}`,
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
`ts-node`,
require.resolve(
`../scripts/${

View File

@ -50,6 +50,7 @@ program
.action(make);
program
.command('start')
.option('--sourceMap', 'sourceMap')
.option('--analyze', 'analyze')
.option('-t, --target <target>', 'target')
.option('-m, --mode <mode>', 'mode')
@ -59,6 +60,7 @@ program
.action(build);
program
.command('build')
.option('--sourcemap', 'sourcemap')
.option('--analyze', 'analyze')
.option('-t, --target <target>', 'target')
.option('-m, --mode <mode>', 'mode')

View File

@ -43,6 +43,7 @@ export function packageJsonContent({
"start:web": "${cliBinName} start --target web --mode development",
"build:web": "${cliBinName} build --target web --mode production",
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
"build-sourcemap-analyze:web": "${cliBinName} build --target web --mode production --sourcemap --analyze",
"build": "tsc",
"server:init": ${serverInitScript},
"server:start": ${serverStartScript},
@ -71,9 +72,9 @@ export function packageJsonContent({
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"rmc-pull-to-refresh": "^1.0.13",
"tdesign-icons-react": "^0.1.4",
"tdesign-icons-react": "^0.1.6",
"tdesign-mobile-react": "^0.2.0",
"tdesign-react": "^0.40.5",
"tdesign-react": "^0.42.2",
"url": "^0.11.0",
"uuid": "^8.3.2"
},