0.1.8 • Published 8 years ago
gulp-typespace v0.1.8
gulp-typespace
Typespace plugin for Gulp.
Usage
All parameters supported by Typespace can be passed as a settings object.
Required arguments/flags:
namespace
- name of the root namespace
Optional arguments/flags:
config
- input tsconfig.json file path to load files fromfiles
- paths of files to includeoutFile
- output .ts file pathpathPrefix
- directory root to ignore from module pathsroot
- root path to search for files under
const typespace = require("gulp-typespace");
gulp.task("typespace", () => {
const settings = {
config: "./tsconfig.json",
namespace: "MyProject",
pathPrefix: "src/",
root: "."
};
typespace(settings)
.pipe(gulp.dest("dist"));
});
You can also pass a callback to be executed instead of creating a stream. It will receive the generated text as a string.
const typespace = require("gulp-typespace");
gulp.task("typespace", () => {
const settings = {
config: "./tsconfig.json",
rootNamespace: "MyProject",
root: "."
};
typespace(settings, text => console.log(text));
});