使用path的resolve

This commit is contained in:
wkj 2024-01-03 16:14:22 +08:00
parent c1639a6752
commit 4aae866a6a
8 changed files with 10 additions and 10 deletions

View File

@ -52,7 +52,7 @@ async function build(cmd) {
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
`node`,
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
(0, path_1.resolve)(`../scripts/${mpFileMap[mode]}`),
(0, path_1.resolve)(__dirname, `../scripts/${mpFileMap[mode]}`),
].filter(Boolean), {
stdio: 'inherit',
shell: true,
@ -81,7 +81,7 @@ async function build(cmd) {
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
`node`,
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
(0, path_1.resolve)(`../scripts/${webFileMap[mode]}`),
(0, path_1.resolve)(__dirname, `../scripts/${webFileMap[mode]}`),
].filter(Boolean), {
stdio: 'inherit',
shell: true,

View File

@ -7,7 +7,7 @@ const path_1 = require("path");
async function make() {
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`make oak-app-domain`)}`);
// ts-node scripts/build-app-domain & npm link ./app-domain
const result = cross_spawn_1.default.sync('ts-node', [(0, path_1.resolve)(__dirname, '../scripts/' + 'make-app-domain.js')], {
const result = cross_spawn_1.default.sync('ts-node', [(0, path_1.resolve)(__dirname, '../scripts/make-app-domain.js')], {
stdio: 'inherit',
shell: true,
});

View File

@ -7,7 +7,7 @@ const path_1 = require("path");
async function make(cmd, watch) {
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`make locales`)}`);
// ts-node scripts/build-app-domain & npm link ./app-domain
const args = [(0, path_1.resolve)(__dirname, '../scripts/' + 'make-locale.js')];
const args = [(0, path_1.resolve)(__dirname, '../scripts/make-locale.js')];
if (watch) {
args.push('true');
}

View File

@ -7,7 +7,7 @@ const path_1 = require("path");
async function make(cmd, watch) {
(0, tip_style_1.Success)(`${(0, tip_style_1.success)(`make router`)}`);
// node scripts/make-router.js subdir watch
const args = [(0, path_1.resolve)(__dirname, '../scripts/' + 'make-router.js'), cmd.subdir];
const args = [(0, path_1.resolve)(__dirname, '../scripts/make-router.js'), cmd.subdir];
if (watch) {
args.push('true');
const result = (0, cross_spawn_1.default)('node', args, {

View File

@ -75,7 +75,7 @@ export default async function build(cmd: any) {
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
`node`,
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
resolve(`../scripts/${mpFileMap[mode]}`),
resolve(__dirname, `../scripts/${mpFileMap[mode]}`),
].filter(Boolean),
{
stdio: 'inherit',
@ -106,7 +106,7 @@ export default async function build(cmd: any) {
!!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`,
`node`,
cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`,
resolve(`../scripts/${webFileMap[mode]}`),
resolve(__dirname, `../scripts/${webFileMap[mode]}`),
].filter(Boolean),
{
stdio: 'inherit',

View File

@ -15,7 +15,7 @@ export default async function make() {
// ts-node scripts/build-app-domain & npm link ./app-domain
const result = spawn.sync(
'ts-node',
[resolve(__dirname, '../scripts/' + 'make-app-domain.js')],
[resolve(__dirname, '../scripts/make-app-domain.js')],
{
stdio: 'inherit',
shell: true,

View File

@ -13,7 +13,7 @@ import { resolve } from 'path';
export default async function make(cmd: any, watch?: boolean) {
Success(`${success(`make locales`)}`);
// ts-node scripts/build-app-domain & npm link ./app-domain
const args = [resolve(__dirname, '../scripts/' + 'make-locale.js')];
const args = [resolve(__dirname, '../scripts/make-locale.js')];
if (watch) {
args.push('true');
}

View File

@ -13,7 +13,7 @@ import { resolve } from 'path';
export default async function make(cmd: any, watch?: boolean) {
Success(`${success(`make router`)}`);
// node scripts/make-router.js subdir watch
const args = [resolve(__dirname, '../scripts/' + 'make-router.js'), cmd.subdir];
const args = [resolve(__dirname, '../scripts/make-router.js'), cmd.subdir];
if (watch) {
args.push('true');
const result = spawn(