mp3por
mp3por

Reputation: 1852

Grunt ts task configuration - no files found

I am trying to include TS compilation to my project. This is my tsconfig.json:

{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "system",
    "moduleResolution": "node",
    "noImplicitAny": false,
    "outDir": "build/develop/assets/scripts",
    "removeComments": false,
    "rootDir": "assets/management/",
    "sourceMap": false,
    "target": "ES5"
  },
  "exclude": [
    "node_modules"
  ]
}

And this is my tasks/config/ts.js file:

/**
 * Compile TS files to JS.
 *
 * @see https://github.com/TypeStrong/grunt-ts
 */
module.exports = function (grunt) {
    grunt.config.set('ts', {
        angular_app_dev: {
            default: {
                // src: [
                //     "assets/management/**/*.ts",
                //     "!node_modules/**/*.ts" // Avoid compiling TypeScript files in node_modules
                // ],
                // outDir: "assets/vili2",
                tsconfig: {
                    tsconfig: true,
                    ignoreFiles: false,
                    ignoreSettings: false,
                    overwriteFilesGlob: false,
                    updateFiles: true,
                    passThrough: false
                }
                // options: {
                //     module: 'commonjs',
                //     // To compile TypeScript using external modules like NodeJS
                //     fast: 'never'
                //     // You'll need to recompile all the files each time for NodeJS
                // }
            }

        }
    });

    grunt.loadNpmTasks('grunt-ts');
};

I am trying to make it so that it compiles the TS files ( later I want to add a watch so that it compiles them every time I change them, but one thing at a time )

When I run "tsc" from the command line it works perfectly, however if I run

grunt ts:angular_app_dev -verbose

it produces this:

$ grunt ts:angular_app_dev -verbose
Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.

Registering "grunt-contrib-clean" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-clean\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-clean\package.json...OK
Loading "clean.js" tasks...OK
+ clean

Registering "grunt-contrib-coffee" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-coffee\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-coffee\package.json...OK
Loading "coffee.js" tasks...OK
+ coffee

Registering "grunt-contrib-concat" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-concat\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-concat\package.json...OK
Loading "concat.js" tasks...OK
+ concat

Registering "grunt-contrib-copy" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-copy\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-copy\package.json...OK
Loading "copy.js" tasks...OK
+ copy

Registering "grunt-contrib-cssmin" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-cssmin\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-cssmin\package.json...OK
Loading "cssmin.js" tasks...OK
+ cssmin

Registering "grunt-contrib-jst" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-jst\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-jst\package.json...OK
Loading "jst.js" tasks...OK
+ jst

Registering "grunt-contrib-less" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-less\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-less\package.json...OK
Loading "less.js" tasks...OK
+ less

Registering "grunt-sails-linker" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-sails-linker\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-sails-linker\package.json...OK
Loading "scriptlinker.js" tasks...OK
+ sails-linker

Registering "grunt-sync" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-sync\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-sync\package.json...OK
Loading "sync.js" tasks...OK
+ sync

Registering "grunt-ts" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-ts\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-ts\package.json...OK
Loading "ts.js" tasks...OK
+ ts

Registering "grunt-contrib-uglify" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-uglify\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-uglify\package.json...OK
Loading "uglify.js" tasks...OK
+ uglify

Registering "grunt-contrib-watch" local Npm module tasks.
Reading D:\Work\...\...\node_modules\grunt-contrib-watch\package.json...OK
Parsing D:\Work\...\...\node_modules\grunt-contrib-watch\package.json...OK
Loading "watch.js" tasks...OK
+ watch
Loading "Gruntfile.js" tasks...OK
+ build, buildProd, compileAssets, db:migrate, default, linkAssets, linkAssetsBuild, linkAssetsBuildProd, prod, prodTest, syncAssets

Running tasks: ts:angular_app_dev

Running "ts:angular_app_dev" (ts) task
Verifying property ts.angular_app_dev exists in config...OK
File: [no files]

Done, without errors.

What am I missing ???

Upvotes: 0

Views: 820

Answers (1)

Viktor Leandersson
Viktor Leandersson

Reputation: 95

You are not missing anything. As it says down in the bottom it is "Done, without errors". Remove your -verbose flag for less information about the grunt compilation :)

grunt ts:angular_app_dev should be good enought

Upvotes: 1

Related Questions