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

Option `fast` doesn't allow excluding entries inside `src` #394

Closed dmytro-y-dev closed 7 years ago

dmytro-y-dev commented 7 years ago

When you have something like this in your Gruntfile.js, *.spec.ts files are not ignored.

    ts: {
            dev: {
                src: [
                    'app/**/*.ts',
                    '!app/**/*.spec.ts'
                ],
                outDir: 'dist/dev',
                tsconfig: 'tsconfig.json',
                baseDir: 'app',
                options: {
                    fast: 'always',
                    rootDir: 'app',
                    additionalFlags: 'missing-typings/missing.d.ts typings/index.d.ts' // Include typings during every compilation attempt
                }
            },
        }

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true,
    "allowJs": true
  },
  "exclude": [
    "spec",
    "e2e",
    "node_modules"
  ]
}

When fast is set to never, *.spec.ts files are excluded.

nycdotnet commented 7 years ago

@metamaker I am investigating this now. Does fast still provide value to you? I am considering removing it and recommending that people use the watch functionality built-in to tsc which gives significantly better performance.

nycdotnet commented 7 years ago

Hi - I think I solved the root cause of this in beta 10 as well. It's the same thing - I think the "fast set to never" thing was perhaps a coincidence because you weren't updating the spec files which resulted in them not being picked up for compile. Please test again and let me know if this is not the case.

dmytro-y-dev commented 7 years ago

Ok, will do. Fast option provides great experience, because I use PHPStorm's file watchers instead of grunt watches. We have projects with BIG amount of files, so when you run grunt watch it really feels too slow.

dmytro-y-dev commented 7 years ago

I didn't try tsc's watch, maybe I will look into it later, so thanks for reference :) .

nycdotnet commented 7 years ago

I believe this is resolved in the latest beta on npm. Thank you for all of your assistance troubleshooting this, @metamaker. Please re-open if not. Thank you!