2.3.7-dev
This commit is contained in:
parent
e4ef4ec482
commit
d9e34f8298
90
lib/build.js
90
lib/build.js
|
|
@ -17,33 +17,25 @@ async function build(cmd) {
|
|||
? `split:${!!cmd.split}`
|
||||
: ''}`)}`);
|
||||
if (cmd.target === 'mp' || cmd.target === 'wechatMp') {
|
||||
const result = cross_spawn_1.default.sync(
|
||||
`cross-env`,
|
||||
[
|
||||
`NODE_ENV=${cmd.mode}`,
|
||||
`NODE_TARGET=${cmd.target}`,
|
||||
`SUB_DIR_NAME=${cmd.subDir || 'wechatMp'}`,
|
||||
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
|
||||
`COMPILE_ANALYZE=${!!cmd.analyze}`,
|
||||
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
|
||||
`PROD=${!!cmd.prod}`,
|
||||
`SPLIT=${!!cmd.split}`,
|
||||
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
|
||||
`node`,
|
||||
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
|
||||
require.resolve(
|
||||
`../scripts/${
|
||||
cmd.mode === 'production'
|
||||
? 'build-mp.js'
|
||||
: 'start-mp.js'
|
||||
}`
|
||||
),
|
||||
].filter(Boolean),
|
||||
{
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
const result = cross_spawn_1.default.sync(`cross-env`, [
|
||||
`NODE_ENV=${cmd.mode}`,
|
||||
`NODE_TARGET=${cmd.target}`,
|
||||
`SUB_DIR_NAME=${cmd.subDir || 'wechatMp'}`,
|
||||
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
|
||||
`COMPILE_ANALYZE=${!!cmd.analyze}`,
|
||||
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
|
||||
`PROD=${!!cmd.prod}`,
|
||||
`SPLIT=${!!cmd.split}`,
|
||||
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
|
||||
`node`,
|
||||
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
|
||||
require.resolve(`../scripts/${cmd.mode === 'production'
|
||||
? 'build-mp.js'
|
||||
: 'start-mp.js'}`),
|
||||
].filter(Boolean), {
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
});
|
||||
if (result.status === 0) {
|
||||
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`执行完成`)}`);
|
||||
}
|
||||
|
|
@ -52,32 +44,24 @@ async function build(cmd) {
|
|||
}
|
||||
}
|
||||
else if (cmd.target === 'web') {
|
||||
const result = cross_spawn_1.default.sync(
|
||||
`cross-env`,
|
||||
[
|
||||
`NODE_ENV=${cmd.mode}`,
|
||||
`NODE_TARGET=${cmd.target}`,
|
||||
`SUB_DIR_NAME=${cmd.subDir || 'web'}`,
|
||||
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
|
||||
`COMPILE_ANALYZE=${!!cmd.analyze}`,
|
||||
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
|
||||
`PROD=${!!cmd.prod}`,
|
||||
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
|
||||
`node`,
|
||||
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
|
||||
require.resolve(
|
||||
`../scripts/${
|
||||
cmd.mode === 'production'
|
||||
? 'build-web.js'
|
||||
: 'start-web.js'
|
||||
}`
|
||||
),
|
||||
].filter(Boolean),
|
||||
{
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
const result = cross_spawn_1.default.sync(`cross-env`, [
|
||||
`NODE_ENV=${cmd.mode}`,
|
||||
`NODE_TARGET=${cmd.target}`,
|
||||
`SUB_DIR_NAME=${cmd.subDir || 'web'}`,
|
||||
`TSC_COMPILE_ON_ERROR=${TSC_COMPILE_ON_ERROR}`,
|
||||
`COMPILE_ANALYZE=${!!cmd.analyze}`,
|
||||
`GENERATE_SOURCEMAP=${!!cmd.sourcemap}`,
|
||||
`PROD=${!!cmd.prod}`,
|
||||
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
|
||||
`node`,
|
||||
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
|
||||
require.resolve(`../scripts/${cmd.mode === 'production'
|
||||
? 'build-web.js'
|
||||
: 'start-web.js'}`),
|
||||
].filter(Boolean), {
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
});
|
||||
if (result.status === 0) {
|
||||
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`执行完成`)}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@xuchangzju/oak-cli",
|
||||
"version": "2.3.6",
|
||||
"version": "2.3.7",
|
||||
"description": "oak-cli脚手架",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
|
@ -86,8 +86,8 @@
|
|||
"loader-utils": "^3.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mini-css-extract-plugin": "^2.5.3",
|
||||
"oak-backend-base": "^2.4.1",
|
||||
"oak-domain": "^2.6.8",
|
||||
"oak-backend-base": "file:../oak-backend-base",
|
||||
"oak-domain": "file:../oak-domain",
|
||||
"postcss": "^8.4.4",
|
||||
"postcss-flexbugs-fixes": "^5.0.2",
|
||||
"postcss-less": "^6.0.0",
|
||||
|
|
|
|||
Loading…
Reference in New Issue