Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build time is raising with each incremental compilation #533

Closed
slavafomin opened this issue Jul 31, 2017 · 4 comments
Closed

Build time is raising with each incremental compilation #533

slavafomin opened this issue Jul 31, 2017 · 4 comments

Comments

@slavafomin
Copy link

slavafomin commented Jul 31, 2017

Hello!

Thank you for this great module!

However, I'm experiencing the situation where built time is raising with each sequential incremental build.

Here's the output:

$ ./node_modules/.bin/gulp sources:watch
[02:45:16] Requiring external module ts-node/register
[02:45:19] Using gulpfile ~/projects/moebius/backend/moebius-server/gulpfile.ts
[02:45:19] Starting 'sources:compile'...
[02:45:27] Finished 'sources:compile' after 7.41 s
[02:45:27] Starting 'sources:watch'...
[02:45:31] Starting 'sources:compile'...
[02:45:41] Finished 'sources:compile' after 11 s
[02:45:44] Starting 'sources:compile'...
[02:46:01] Finished 'sources:compile' after 17 s
[02:46:04] Starting 'sources:compile'...
[02:46:26] Finished 'sources:compile' after 23 s
[02:46:33] Starting 'sources:compile'...
[02:47:01] Finished 'sources:compile' after 27 s
[02:47:26] Starting 'sources:compile'...
[02:48:02] Finished 'sources:compile' after 36 s

Here's my gulpfile.ts:

I'm using Gulpclass module for convenience.

import * as gulp from 'gulp';
import * as sourcemaps from 'gulp-sourcemaps';
import * as ts from 'gulp-typescript';

import {Gulpclass, Task} from 'gulpclass';


const tsProject = ts.createProject('tsconfig.json');

const sourcesGlob = './src/**/*.ts';


@Gulpclass()
export class Gulpfile {

  @Task('sources:compile')
  sourcesCompile (): any {

    return gulp.src(sourcesGlob)
      .pipe(sourcemaps.init())
      .pipe(tsProject()).js
      .pipe(sourcemaps.write('./'))
      .pipe(gulp.dest('./build/'))
    ;

  }

  @Task('sources:watch', ['sources:compile'])
  sourcesWatch () {
    return gulp.watch(sourcesGlob, ['sources:compile']);
  }

}

And here's my tsconfig.json:

{
  "compilerOptions": {
    "lib": ["es6"],
    "module": "commonjs",
    "target": "ES6",
    "alwaysStrict": true,
    "noImplicitAny": true,
    "outDir": "build/",
    "pretty": true,
    "removeComments": true,
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "rootDir": "./",
    "declaration": true
  },
  "include": [
    "gulpfile.ts",
    "src/**/*"
  ],
  "exclude": [
    "node_modules/",
    "src/**/~*"
  ]
}

Do you know, what could be the problem?

Thank you!


$ ./node_modules/.bin/gulp --version
[02:55:00] Requiring external module ts-node/register
[02:55:00] CLI version 3.9.1
[02:55:00] Local version 3.9.1
$ tsc --version
Version 2.4.1
@slavafomin
Copy link
Author

After further investigation it looks like the problem is related to sourcemaps. When I remove sourcemap generation from my stream it starts to work as expected:

// Works correctly:
return gulp.src(sourcesGlob)
//  .pipe(sourcemaps.init())
  .pipe(tsProject()).js
//  .pipe(sourcemaps.write('./'))
  .pipe(gulp.dest('./build/'))
;

@ivogabe
Copy link
Owner

ivogabe commented Sep 20, 2017

Strange, I don't know how that can happen. Could you take a look if the memory usage increases after each build? That might point to a memory leak.

@ivogabe
Copy link
Owner

ivogabe commented Feb 7, 2018

Is this still an issue with the latest release?

@ivogabe
Copy link
Owner

ivogabe commented Jun 11, 2018

I close this as this issue seems inactive. A similar issue can be found at #549.

@ivogabe ivogabe closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants