3.0.1 • Published 2 years ago

rollup-plugin-tsnew v3.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
2 years ago

rollup-plugin-tsnew

a rollup plugin for compile ts file

options

  • include: FilterPattern; files need include to compile.
  • exclude: FilterPattern; files need exclude to compile.
  • check: boolean; is check ts file.
  • enableConditionCompile: boolean; 是否启用条件编译
  • defines: Record<string, boolean>; 全局变量,用于条件编译

usage

import typescript from 'rollup-plugin-tsnew'

module.exports = {
    plugins: [typescript()]
};

example 启动条件编译

原始代码

//#if DEBUG
console.log('this is debug code');
//#el
console.log('production code');
//#endif
console.log('some other code');

rollup plugin config

import typescript from 'rollup-plugin-tsnew'

module.exports = {
    plugins: [
        typescript({
            enableConditionCompile: true,
            defines: { DEBUG: true }
        })
    ]
};

原始代码将会编译成

//#if DEBUG
console.log('this is debug code');
//#el
console.log('some other code');
3.0.1

2 years ago

3.0.0

2 years ago

2.9.1

2 years ago

2.5.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.9.0

2 years ago

2.8.0

2 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago