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

Too much time to compile files #10

Open
MACruzDeveloper opened this issue Sep 12, 2016 · 3 comments
Open

Too much time to compile files #10

MACruzDeveloper opened this issue Sep 12, 2016 · 3 comments
Assignees
Labels

Comments

@MACruzDeveloper
Copy link

MACruzDeveloper commented Sep 12, 2016

Hi,

I am testing this plugin in a folders structure with jade files (with includes, mixins... and dependencies between them):

-jade
--mixins
--includes
--layouts
--views

It seems to work perfectly when the match only affect a view, but as I add more matches to more views, when I change some file in a subfolder, the time it takes to compile the view increases coming to take 9-10 seconds to change.. Is this behavior normal?? Is there any solution to decrease the time?

gulp.task('compileJade', function(){
    return gulp.src('app/jade/views/**/*.jade')
        .pipe(changed({
          matcher: /#include\s+"(.+)"/g,
          dest: function(srcRelPath, srcBasePath) {
            return rename(srcRelPath, function(fileObj) {
              return {
                dirname: Path.join('app/html/' + fileObj.dirname),
                extname: '.html'
              };
            });
          },
        }))
        .pipe(jade()
        .pipe(gulp.dest('app/html'))
});

gulp.watch('app/jade/**/*.jade', ['compileJade']);

Thanks!

@Kuniwak Kuniwak self-assigned this Sep 12, 2016
@Kuniwak
Copy link
Contributor

Kuniwak commented Sep 12, 2016

@TxikiCruz

Thanks for reporting.

Could you try the debug option please?
This plugin can print debug output if it is true.
I want to see the debug output.

@Kuniwak
Copy link
Contributor

Kuniwak commented Sep 12, 2016

I think that some circular dependencies are included in your code.

Because your debug output says that "stocks-see-favourites.jade is depended by itself".
(NOTE: Related files "XXX" (from "YYY") means that "XXX depended by YYY")

Could you resolve the circular dependencies?

@MACruzDeveloper
Copy link
Author

You are right, some of dependencies are circular as you say, and I can see another problem now, the dependencies multiply every time I add a match in a view.

I think my tasks are not right, I will try to find the right way, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants