diff --git a/packages/frontend-shared/build.js b/packages/frontend-shared/build.js index 17b6da8d3..994111475 100644 --- a/packages/frontend-shared/build.js +++ b/packages/frontend-shared/build.js @@ -23,10 +23,14 @@ const options = { sourcemap: 'linked', }; -// js-built配下をすべて削除する -fs.rmSync('./js-built', { recursive: true, force: true }); +const args = process.argv.slice(2).map(arg => arg.toLowerCase()); -if (process.argv.map(arg => arg.toLowerCase()).includes('--watch')) { +// js-built配下をすべて削除する +if (!args.includes('--no-clean')) { + fs.rmSync('./js-built', { recursive: true, force: true }); +} + +if (args.includes('--watch')) { await watchSrc(); } else { await buildSrc(); diff --git a/packages/misskey-bubble-game/build.js b/packages/misskey-bubble-game/build.js index a80b71646..5d534cc6f 100644 --- a/packages/misskey-bubble-game/build.js +++ b/packages/misskey-bubble-game/build.js @@ -23,10 +23,14 @@ const options = { sourcemap: 'linked', }; -// built配下をすべて削除する -fs.rmSync('./built', { recursive: true, force: true }); +const args = process.argv.slice(2).map(arg => arg.toLowerCase()); -if (process.argv.map(arg => arg.toLowerCase()).includes('--watch')) { +// built配下をすべて削除する +if (!args.includes('--no-clean')) { + fs.rmSync('./built', { recursive: true, force: true }); +} + +if (args.includes('--watch')) { await watchSrc(); } else { await buildSrc(); diff --git a/packages/misskey-js/build.js b/packages/misskey-js/build.js index a80b71646..b79459281 100644 --- a/packages/misskey-js/build.js +++ b/packages/misskey-js/build.js @@ -24,9 +24,14 @@ const options = { }; // built配下をすべて削除する -fs.rmSync('./built', { recursive: true, force: true }); +const args = process.argv.slice(2).map(arg => arg.toLowerCase()); -if (process.argv.map(arg => arg.toLowerCase()).includes('--watch')) { +// built配下をすべて削除する +if (!args.includes('--no-clean')) { + fs.rmSync('./built', { recursive: true, force: true }); +} + +if (args.includes('--watch')) { await watchSrc(); } else { await buildSrc(); diff --git a/packages/misskey-reversi/build.js b/packages/misskey-reversi/build.js index a80b71646..5d534cc6f 100644 --- a/packages/misskey-reversi/build.js +++ b/packages/misskey-reversi/build.js @@ -23,10 +23,14 @@ const options = { sourcemap: 'linked', }; -// built配下をすべて削除する -fs.rmSync('./built', { recursive: true, force: true }); +const args = process.argv.slice(2).map(arg => arg.toLowerCase()); -if (process.argv.map(arg => arg.toLowerCase()).includes('--watch')) { +// built配下をすべて削除する +if (!args.includes('--no-clean')) { + fs.rmSync('./built', { recursive: true, force: true }); +} + +if (args.includes('--watch')) { await watchSrc(); } else { await buildSrc(); diff --git a/scripts/dev.mjs b/scripts/dev.mjs index ede77554d..3f66028be 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.mjs @@ -27,20 +27,7 @@ await Promise.all([ stdout: process.stdout, stderr: process.stderr, }), - execa('pnpm', ['--filter', 'misskey-js', 'build'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), -]); - -await Promise.all([ - execa('pnpm', ['--filter', 'misskey-reversi', 'build'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, - }), - execa('pnpm', ['--filter', 'misskey-bubble-game', 'build'], { + execa('pnpm', ['--filter', 'backend...', 'build'], { cwd: _dirname + '/../', stdout: process.stdout, stderr: process.stderr, @@ -65,7 +52,7 @@ execa('pnpm', ['--filter', 'backend', 'dev'], { stderr: process.stderr, }); -execa('pnpm', ['--filter', 'frontend-shared', 'watch'], { +execa('pnpm', ['--filter', 'frontend-shared', 'watch', '--no-clean'], { cwd: _dirname + '/../', stdout: process.stdout, stderr: process.stderr, @@ -89,19 +76,19 @@ execa('pnpm', ['--filter', 'sw', 'watch'], { stderr: process.stderr, }); -execa('pnpm', ['--filter', 'misskey-js', 'watch'], { +execa('pnpm', ['--filter', 'misskey-js', 'watch', '--no-clean'], { cwd: _dirname + '/../', stdout: process.stdout, stderr: process.stderr, }); -execa('pnpm', ['--filter', 'misskey-reversi', 'watch'], { +execa('pnpm', ['--filter', 'misskey-reversi', 'watch', '--no-clean'], { cwd: _dirname + '/../', stdout: process.stdout, stderr: process.stderr, }); -execa('pnpm', ['--filter', 'misskey-bubble-game', 'watch'], { +execa('pnpm', ['--filter', 'misskey-bubble-game', 'watch', '--no-clean'], { cwd: _dirname + '/../', stdout: process.stdout, stderr: process.stderr,