0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WSL起動とnpm run buildをワンタッチで行う

Posted at

環境

Windows10/11
docker(postgre SQLとredisが載ってる)をwslで起こしている。

実現したいこと

npm run build、PowerShell起動を同時に実行
(いちいちコマンドプロンプトでコマンドを書き込み実行するのはだるい)

実現方法

.batファイルでまとめて実行できるようにする

start.bat
start powershell -Command "wsl"
cd C:\pleiades\Git\project\project-web
call npm run build
call npm run watch

説明

start powershell -Command "wsl"

PowerShellを起動しwslコマンドを実行する(そのまま)。
-Windowstyle Hidden -NoProfileを付けて窓を即閉じすることもできる。

start powershell -Windowstyle Hidden -NoProfile -Command "wsl"
cd C:\pleiades\Git\project\project-web

npmを実行するフォルダまで移動(任意)。

call npm run build

デプロイ。batファイルからコマンドを実行する際はcallが必要。

call npm run watch

開発中、ファイルに変更をかければ環境に反映してくれるコマンド。便利。
こちらもcallを付ける。

結果

ワンクリックで開発環境が立ち上がってらくちんですね。

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?