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