TypeStrong / grunt-ts

A grunt task to manage your complete typescript development to production workflow
https://www.npmjs.com/package/grunt-ts
MIT License
330 stars 121 forks source link

tsx are compiled to js #408

Closed IdanDavidi closed 7 years ago

IdanDavidi commented 7 years ago

Hello, I am trying to compile tsx files to jsx files, but they compile to .js files. any idea why?

    ts: {
      server: {
        files: [{
          src: ["src/\*\*/\*.ts", "!src/.baseDir.ts"],
          dest: "./dist"
        }],
        options: {
          module: "commonjs",
          target: "es6",
          sourceMap: false
        }
      },
      webclient: {
        files: [{
          src: ["clients/WebClient/src/**/*.ts", "clients/WebClient/src/**/*.tsx", "!clients/WebClient/src/.baseDir.ts"],
          dest: "./dist/public/WebClient/src"
        }],
        options: {
          module: "commonjs",
          target: "es5",
          sourceMap: true,
      jsx: "react"
        }
      }
    },

Thanks.

nycdotnet commented 7 years ago

Use jsx setting preserve.

https://www.typescriptlang.org/docs/handbook/jsx.html https://github.com/TypeStrong/grunt-ts#jsx

IdanDavidi commented 7 years ago

thank you, I wasn't aware of it.