k-maru / grunt-typescript

MIT License
137 stars 60 forks source link

es6 doesn't compile classes #116

Closed groege closed 7 years ago

groege commented 9 years ago

If i compile with "target: 'es5'" everything works fine. But if i switch to es6, my ts files are not being compiled, even though files are generate. Can you help me with this? I wanted to encapsule my whole project into a module so i wont interfere with any other js file that may be uses as well. Thanks.

Finkes commented 8 years ago

yeah same problem here, es5 creates files just fine but es6 does not generate any file

groege commented 8 years ago

In my case it does create files but the new "js" file still has classes,...

Finkes commented 8 years ago

That should be fine as ES6 really supports classes

Finkes commented 8 years ago

Currently I use a custom grunt task for that:

grunt.registerTask('typescript', 'compile app and tests', function() {
    var done = this.async();

    grunt.util.spawn({
      grunt: false,
      cmd: "tsc",
      args: ["-p", "./src/server", "-sourcemap"],
      opts: {
        stdio: "inherit"
      }
    }, function(err, result, stderr) {
      grunt.log.ok('successfully transpiled typescript!');
      done();
    });
  });
groege commented 7 years ago

I know it's been a while, sorry. I think we can close this ;)