TypeScript Asset-Pipeline
The typescript-asset-pipeline
is an Asset Pipeline module that compiles TypeScript files using v1.7.5 of the compiler.
Note
|
This is a work in progress and will need more extensive testing, performance improvements, etc. Until version 1.0 it should not be considered production ready. |
Getting Started
Gradle / Grails 3
build.gradle
plugins {
id 'com.bertramlabs.asset-pipeline' version '2.5.0'
}
dependencies {
assets 'com.craigburke:typescript-asset-pipeline:0.3.0'
}
Grails 2
BuildConfig.groovy
dependencies {
compile 'com.craigburke:typescript-asset-pipeline:0.3.0'
}
How it Works
This plugin will compile any file with a .ts
extension into corresponding JavaScript. It also supports the use of declaration files (d.ts
).
Configuration
You can set additional compiler options by setting the typeScript map.
build.gradle
assets {
configOptions: [
typeScript: [
module:'commonjs' // (1)
target:'es5'
experimentalDecorators:true // (2)
]
]
}
-
This translates to
--module commonjs
-
Since a boolean is provided as the value, this is treated as a flag and translates to
--experimentalDecorators