chirag
chirag

Reputation: 1828

Task "typescript" failed in grunt

I have written below code in gruntFile.js.

typescript: {
            base: {
                options: {
                    target: 'es5',
                    sourceMap: true,
                    noImplicitAny: true
                }
            },
            default: {
                files: [
                  { src: 'source/tests/**/*.ts', dest: 'build'},
                  { src: 'source/scripts/**/*.ts', dest: 'build'}
                ]
            }
        },

and I am trying to run "grunt typescript" command from command line. It is showing below error.

enter image description here

I have tryed "grunt typescript --force" command also. but still it is not working. enter image description here

still it is not create build folder and it means that task is not working properly. Thanks in advance.

EDIT:- I have change my gruntfile.js to below as suggest in answer.

typescript: {
            base: {
                src: ['source/tests/**/*.ts'],
                dest: 'build/',
                options: {
                    target: 'es5',
                    sourceMap: true,
                    noImplicitAny: true
                }
            },
} 

But still I am facing same problem.

Upvotes: 2

Views: 687

Answers (1)

SBI
SBI

Reputation: 2322

Looking at the most current documentation that I could find for grunt-typescript, your syntax is wrong. I have a feeling that you actually want to be using grunt-ts. It's also the plugin I know of that is compatible with the syntax you've supplied.

My personal opinion: Use grunt-ts, it's been much easier to work with, and I've gone through a few iterations of trying out a bunch of tools to get to our current build environment.

Upvotes: 5

Related Questions