TypeStrong / grunt-ts

A grunt task to manage your complete typescript development to production workflow
https://www.npmjs.com/package/grunt-ts
MIT License
330 stars 121 forks source link

Not able to compile different typescript file to different destination #379

Closed shrimpy closed 7 years ago

shrimpy commented 8 years ago

I have gruntfile.js as below, but seems like grunt-ts is only take care of the first entry in files, completely ignore the second entry. I don't see ts file under "server_tests" get compile, or any output file been copy to dist_tests

{ src: ["server_tests/**/*.ts", "!server_tests/.baseDir.ts", "!server_tests/_all.d.ts"], dest: "./dist_tests" }

module.exports = function (grunt) {
    "use strict";

    grunt.initConfig({
        ts: {
            app: {
                files: [{
                    src: ["server/**/*.ts", "!server/.baseDir.ts", "!server/_all.d.ts"],
                    dest: "./dist"
                },
                {
                    src: ["server_tests/**/*.ts", "!server_tests/.baseDir.ts", "!server_tests/_all.d.ts"],
                    dest: "./dist_tests"
                }],
                options: {
                    module: "commonjs",
                    noLib: true,
                    target: "es6",
                    sourceMap: true
                }
            }
        },
        copy: {
            files: {
                cwd: "server/public",  // set working folder / root to copy
                src: "**/*",           // copy all files and subfolders
                dest: "dist/public",   // destination folder
                expand: true           // required when using cwd
            }
        },
        watch: {
            ts: {
                files: ["server/**/*.ts", "server/public/**/*"],
                tasks: ["ts", "copy"]
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-watch");
    grunt.loadNpmTasks("grunt-contrib-copy");
    grunt.loadNpmTasks("grunt-ts");
    grunt.loadNpmTasks("grunt-tslint");

    grunt.registerTask("default", [
        "ts",
        "copy"
    ]);
};
nycdotnet commented 8 years ago

Are you using watch? or do you mean it doesn't work when you run the default task? If the latter, can you please run grunt with --verbose and post the output?

nycdotnet commented 7 years ago

Hi @shrimpy - I'm going to close this out since I haven't heard back from you. If you would like to troubleshoot this further, please reopen. Thanks.