0

My intention is to compile *.ts files location in the (And any subdirectories) of src/main/ts/. I have tsconfig.json file that looks like this:

    {
        "filesGlob": [
            "src/main/ts/**/*.ts"
        ],
        "compilerOptions": {
            "experimentalDecorators": true,
            "noImplicitAny": true,
            "moduleResolution": "node",
            "target": "es6"
        }
    }

My gulp task looks like this:

    var gulp = require('gulp');
    var ts = require('gulp-typescript');
    var tsProject = ts.createProject("tsconfig.json");

    gulp.task('default', function() {
      return tsProject.src()
        .pipe(tsProject())
        .js.pipe(gulp.dest("target/main/js"));
    });

I was having a compilation issue with some of the files in src/main/ts/ so I moved these to a directory in the root of the project called temp.

However the gulp task compiles the files in temp as well. I get errors like these:

temp/main/ts/domain/Order.ts(11,11): error TS1146: Declaration expected.

Thoughts?

1
  • You're missing an import in order.ts. please provide the code in order.ts Commented Apr 30, 2017 at 19:43

1 Answer 1

2

According to the tsconfig.json documentation, you should use "include" (and if needed, "exclude") to specify the files to compile, not "filesGlob"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.