1.3.3 • Published 8 months ago

xtsc v1.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

XTSC

A Typescript loader, bundler and compiler, that use SWC and ESBUILD.

  • To install: npm i -g xtsc or npm i -D xtsc

  • To use: xtsc [action] [file|flags] or npx xtsc [action] [files|flags] or xtsc [file][flags] to run a single file

*New: New command available: xwtsc. What this new command does: | Action | What it does | |--|--| | blank space | REPL | | build | build the project | | bundle entry point output point | bundle the project | | watch file | Watch and run on changes | | run file or only file| Run program | | check | Type check the whole project | | init | Create a tsconfig.json |

flagAvailable on
--watchbuild, bundle, check
--args: [args for program]watch, run (must be the last flag)
--minifybundle
--tsconfig your tsconfig.jsonevery command

The point of this new command, is to use the most Typescript's API services, so, will build using the Typescript's Compiler, will make typecheck before initialize the program, and, will use the transpileModule method.

*New:

Now, you can use path alias in your project. Can be used in run, watch, bundle, build

Actions:

ActionWhat it does
blank spaceREPL
build root dir build dir or file out fileBuild the project/file
bundle file bundle fileBundle a file
watch fileWatch for changes in .ts .mts and .cts files
run file or only fileRun a .ts file
checkType check the whole project
initCreate a tsconfig.json file

Each action has certain flags:

Build:

  • --minify Will minify each Javascript file.

  • --sourceMaps Will save the the source map of each file.

  • --watch Watch for changes.

  • --noClear Avoid clearing the console when you are using the --watch flag.

Bundle:

  • --minify Will minify the .js file.

  • --sourceMaps Will save the source map of the file.

  • --watch Watch for changes.

  • --noClear Avoid clearing the console when you are using the --watch flag.

Run / Watch:

  • --noClear Avoid clearing the console when the program initializes.

  • --args= [...args] Args for your program, this flag, must be the last flag.

Check:

  • --watch Watch for changes.

  • --tsconfig [tsconfig]Will search and use the provided tsconfig.

Notes:

My idea, is, in the case you are using "type": "module" in your package.json, you import all your Typescript files with Ts extensions, so, you can use allowImportingTsExtensions in your tsconfig.json.

With this idea, when you build your project, xtsc will change all the Ts extensions to Js extensions.

In the case you are using "type": "commonjs", you can also import your Typescript files with Ts extensions extension, but, is not necessary.

Important:

In the case you are using "type": "module" , xtsc will obligate you to import all your Typescript files with Ts extensions.

In other case, if you are using "type": "commonjs", you may not have to worry about this, but, in the case you import your Typescript files with Js extensions, xtsc will obligate you to import your files with Ts extensions.

Remember, xtsc will change the .ts | .mts | .cts extensions to .js | .mjs | .cjs extensions on build.

And, xtsc will respect .mts and .cts extensions!

1.2.0

10 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.1.9

11 months ago

1.1.8

11 months ago

1.2.6

8 months ago

1.1.7

11 months ago

1.2.5

8 months ago

1.1.6

11 months ago

1.3.3

8 months ago

1.2.4

8 months ago

1.1.5

11 months ago

1.3.2

8 months ago

1.2.3

8 months ago

1.1.4

11 months ago

1.3.1

8 months ago

1.2.2

9 months ago

1.1.3

11 months ago

1.0.4

11 months ago

1.3.0

8 months ago

1.2.1

10 months ago

1.1.2

11 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago