Skip to content

zhouhoujun/typescript-class-annotations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

packaged typescript-class-annotations

This repo is for distribution on npm. The source for this module is in the main repo. Please file issues and pull requests against that repo.

typescript class annotations is a solution for typescript class compile to es5 uglify. for project used tsioc to es5 uglify.

Install

You can install this package either with npm.

npm

npm install typescript-class-annotations --save-dev

Demo

import { classAnnotations } 'typescript-class-annotations';
const ts = require('gulp-typescript');
gulp.src('src/**/*.ts')
    .pipe(classAnnotations())
    .pipe(ts)

Demo for development

Development.create(gulp, __dirname, {
    tasks:[
        <INodeTaskOption>{
            src: 'src',
            dist: 'lib',
            asserts:{
                ts: {
                    //src: '...',
                    //dist:'...',
                    loader: 'development-assert-ts',
                    //also can add pipe works here.
                    tsPipes: [
                        ()=> classAnnotations()
                    ]
                    // or some state use annotation.
                    tsPipes: (ctx) =>{
                        return (ctx.oper &  Operation.deploy?
                        [
                            ()=> classAnnotations()
                        ] : [];
                    }
                }
                ....

https://github.com/zhouhoujun/typescript-class-annotations.git

Documentation

Documentation is available on the typescript-class-annotations docs site.

License

MIT © Houjun

About

typescript class annotations is a solution for typescript class compile to es5 uglify. for tsioc

Resources

Stars

Watchers

Forks

Packages

No packages published