I am using VS2015 and latest TypeScript (1.6.3). The generated JavaScript and map files are generated in Windows-1252 encoding. The source TypeScript files are UTF-8 with BOM. I do need the generated files to be UTF-8 with BOM as well in order to pass Windows Store certification.
Once I manually fix encoding of the generated files it's fine. But then I must include the generated files in source control and fix any newly added files.
There doesn't seem to be any settings to change the encoding. Is this a bug in the compiler?
The project type is jsproj
, which doesn't seem to support tsconfig.json
according to https://github.com/Microsoft/TypeScript/issues/3124
Once I manually fix encoding of the generated files it's fine. But then I must include the generated files in source control and fix any newly added files.
Use the emitBOM
and charset
options in tsconfig.json:
{
"compileOnSave": true,
"compilerOptions": {
//... other stuff
"emitBOM": true,
"charset": "utf8"
},
// ...
}
See schema : http://json.schemastore.org/tsconfig
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With