8000 Add some options · Issue #170 · gilamran/tsc-watch · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add some options #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zanminkian opened this issue Apr 7, 2024 · 2 comments
Closed

Add some options #170

zanminkian opened this issue Apr 7, 2024 · 2 comments

Comments

@zanminkian
Copy link

Please consider add some options to make this tool more convenient.

  • --clean: remove the outDir directory before every compilation. (This option extends Add --onEachCompilationStarted option #169)
  • --copyfiles: copy non-ts/js files to outDir. This is an important feature that tsc lacks of. We still have no elegant solution. I hope this tool can solve it.
  • --no-watch: With this option, we can focus this tool only. Otherwise, we have to face both tsc and tsc-watch. It's not very convenient. More Please add a --no-watch option #154

Without these options and #169, I have to write scripts below and install 3 pkgs (rimraf, copyfiles, nodemon). I hope this tool can help like NODE_ENV=local tsc-watch --clean --copyfiles --onSuccess 'node bootstrap.js'. It's much more clear and elegant!

{
  "scripts": {
    "clean": "rimraf dist",
    "compile": "tsc -p tsconfig.build.json",
    "copy-files": "copyfiles -u 1 src/**/*.json dist",
    "build": "npm run clean && npm run compile && npm run copy-files",
    "dev": "NODE_ENV=local nodemon -w src -e ts --exec 'npm run build && node bootstrap.js'",
  }
}
@gilamran
Copy link
Owner
gilamran commented Apr 7, 2024

This is interesting, but I don't think that this is the role of tsc-watch, I want to keep this clean as possible.
You can create a simple wrapper to tsc-watch that does exactly what you offered.
Regarding the no-watch I'll reopen the issue

@gilamran gilamran closed this as completed Apr 7, 2024
@zanminkian
Copy link
Author

You can create a simple wrapper to tsc-watch that does exactly what you offered.

Seems impossible because tsc-watch cannot hook before compilation according to #169. That means I have to continue using rimraf, copyfiles, nodemon until I finish my tsc-watch-x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0