ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
839 stars 129 forks source link

Add GS Extension support #325

Open mizunashi-mana opened 8 years ago

mizunashi-mana commented 8 years ago

I'm using this plugin to write Google Apps Script. Google Apps Script is perfect compatible with JavaScript. So, we can use typescript for Google Apps Script without any helping. However, this plugin seems to have no supports for gs extension.

{
  "compilerOptions": {
    "module": "amd",
    "target": "es5",
    "noImplicitAny": false,
    "outFile": "out/index.gs",
    "sourceMap": false
  },
  "exclude": [
    "node_modules",
    "out"
  ],
  "compileOnSave": false
}

This is my tsconfig.json, and tsc -p . is running without problems. However, gulp-typescript is not running because this plugin is just supported .js for output script extension, isn't it?

My gulpfile.coffee is:

gulp = require 'gulp'
$    = do require 'gulp-load-plugins'

tsProject = $.typescript.createProject 'tsconfig.json',
  typescript: require 'typescript'

gulp.task 'build', ->
  gulp.src [
    'src/**/*.ts'
    'typings/**/*.ts'
  ], {base: 'src'}
    .pipe $.typescript tsProject
    .js # <- deleted `*.gs`
    .pipe gulp.dest '.'

Are there any solutions? Or, add .gs supports, please.

ivogabe commented 8 years ago

Thanks for reporting. I've taken a look and tsc does support this, so this is a bug as gulp-typescript should support that too. In the mean time I would advise you to change the file extension to js in your configuration and rename it afterwards to out/index.gs with gulp-rename.