gulp-typescript icon indicating copy to clipboard operation
gulp-typescript copied to clipboard

Add GS Extension support

Open mizunashi-mana opened this issue 9 years ago • 1 comments

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.

mizunashi-mana avatar Apr 15 '16 01:04 mizunashi-mana

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.

ivogabe avatar Apr 16 '16 09:04 ivogabe