Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio thinks everything is a TypeScript resource

I'm using Cordova to build an app, and I'm trying to get a Windows app to build. Using the Cordova CLI didn't yield any good results, so I tried to build the Visual Studio solution in the platforms/windows folder.

The problem is that it fails building and returns a long list of errors all of which pretty much just say something similar to this:

TS6054 Build: File 'C:/Code/ProjectClosr/Cordova App/platforms/windows/www/Gruntfile.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.

Now, turns out that it thinks all of these files are TypeScript files, even though they are just Readme's, JavaScript files, CSS files etc. and it does that because for some reason all of those files in their properties have 'Package Action' set to TypeScriptCompile. Now, I didn't create this solution obviously, it was autogenerated by Cordova, but I need a way to fix this by somehow setting the 'Package Action' property for all of them back to their real values, instead of everything being a TypeScript resource.

How would I go about doing that?

like image 287
Fabis Avatar asked Dec 06 '15 17:12

Fabis


1 Answers

According to this you should have set "allowJs": true inside your tsconfig.json to allow .js extension.

Hope this help!

"compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "outDir": "./scripts/",
    "allowJs": true
  }
like image 145
Nidust Avatar answered Sep 20 '22 20:09

Nidust