常用终端命令/别名的配置
Note
d/dev
d # nr dev
d a # nr dev:a
d b # nr dev:b
dev # nr dev
dev a # nr dev:a
dev b # nr dev:bw/watch
w # nr watch
w a # nr watch:a
w b # nr watch:b
watch # nr watch
watch a # nr watch:a
watch b # nr watch:bt/test
t # nr test
t a # nr test:a
t b # nr test:b
test # nr test
test a # nr test:a
test b # nr test:bb/build
b # nr build
b a # nr build:a
b b # nr build:b
build # nr build
build a # nr build:a
build b # nr build:bs/server
Note
s/server命令会检查package.json的server 和 start脚本。 并且server的优先级更高。由于start是内置的命令,故别名为server。你可以手动修改Microsoft.Powerbash_profile.ps1调整优先级。
如果你的 package.json 只有 start 脚本
s # nr start
s a # nr start:a
s b # nr start:b
server # nr start
server a # nr start:a
server b # nr start:b如果你的 package.json 有 server 脚本,此时 start 命令会被忽略。
s # nr server
s a # nr server:a
s b # nr server:b
server # nr server
server a # nr server:a
server b # nr server:bhs(基于http-server的web服务容器,如需使用请先安装,可选参数path为服务路径)
hs # http-server $output -c-0 --cors
hs dist # http-server dist $output -c-0 --cors # 此时 http-server 入口为 distvs(使用vscode打开当前目录, 若存在package.json, 自动使用ni下载依赖)
vs # vscode 打开当前目录并且自动下载依赖g(git clone的简化操作, 参数repoUrl为仓库地址, 可选参数dir为克隆地址 )
g https://github.com/microsoft/TypeScript # git clone https://github.com/microsoft/TypeScript
g https://github.com/microsoft/TypeScript ts # git clone https://github.com/microsoft/TypeScript tsgo(git remote -v别名)
go # git remote -vcleanupWindows Only (删除所有node_modules依赖和依赖锁定文件package-lock.json,yarn.lockb,bun.lockb,.pnpm-lock.yaml)
cleanup # 清理缓存o(打开目录)
o # start . / open .
o a # start a / start acls-clear
cls # clearpub
pub # npm publish --access publicpubres
pubres # npm publish --access restrictedrec重载配置
rec
# Mac: source ~/.zshrc
# Windows: . $PROFILE-
复制
.zshrc到~/.zshrc如果没有此文件请先创建 -
执行下面命令重载配置
source ~/.zshrc- 复制
Microsoft.PowerShell_profile.ps1的内容 到你的配置文件内即可 使用vscode打开你的配置
code $PROFILE或者使用 txt 打开
notepad $PROFILE-
复制Microsoft.PowerShell_profile.ps1内容到你的配置文件中并且保存。
-
保存之后需要重载你的配置
. $PROFILE