0.14.0 • Published 12 months ago
@ninjutsu-build/tsc v0.14.0
TSC - Ninjutsu Build
A package to create a ninjutsu-build
rule for running TSC.
Installation
Most likely you require both @ninjutsu-build/tsc
and @ninjutsu-build/core
as a
devDependency
, which can be achieved by running the following npm
command:
$ npm install @ninjutsu-build/core @ninjutsu-build/tsc --save-dev
Basic Example
Given the following simple JavaScript file that prints out numbers 1 to N,
// index.ts
console.log("Hello World!");
We can build a build.ninja
file that will compile index.ts
and
use @ninjutsu-build/node
to run the resulting JavaScript,
import { NinjaBuilder } from "@ninjutsu-build/core";
import { makeTSCRule } from "@ninjutsu-build/tsc";
import { makeNodeRule } from "@ninjutsu-build/node";
import { writeFileSync } from "fs";
// Create a `NinjaBuilder`
const ninja = new NinjaBuilder({
ninja_required_version: "1.1",
builddir: ".mybuilddir",
});
// Create the `tsc` rule and compile `index.ts` to `dist`
const tsc = makeTSCRule(ninja);
const js = tsc({
in: ["index.ts"],
compilerOptions: {
outDir: "dist",
}
});
// Create the `node` rule and invoke the generated JavaScript file,
// saving the output to `$builddir/output.txt`.
const node = makeNodeRule(ninja);
node({
in: js,
out: "$builddir/output.txt",
});
// Write the ninja file to disk
writeFileSync("build.ninja", ninja.output);
0.12.7
1 year ago
0.12.8
1 year ago
0.13.0
1 year ago
0.14.0
12 months ago
0.13.1
1 year ago
0.12.4
1 year ago
0.12.5
1 year ago
0.12.6
1 year ago
0.12.3
1 year ago
0.12.2
1 year ago
0.12.1
1 year ago
0.12.0
1 year ago
0.11.3
1 year ago
0.11.2
1 year ago
0.11.0
1 year ago
0.11.1
1 year ago
0.10.6
1 year ago
0.10.4
1 year ago
0.10.5
1 year ago
0.10.2
1 year ago
0.10.3
1 year ago
0.10.1
1 year ago
0.10.0
1 year ago
0.9.0
1 year ago
0.8.1
1 year ago
0.8.0
1 year ago
0.7.0
1 year ago
0.6.0
1 year ago
0.5.0
2 years ago
0.4.0
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.0.1
2 years ago