This topic contains 1 reply, has 2 voices, and was last updated by Jai Jai 8 months, 1 week ago.

Can gulp command compile the code only if the file has been changed?

  • madjack

    Member Reply #18165


    We use Metronic 5 (default) with core project and added “gulp” command as a pre-build event. That means whenever build the project, gulp command will be called. So we don’t have to run the commands manually each time. This is really great convenience, but there is a little annoyance. Gulp’s compilation takes a long time, even if the code does not change. Our backend dev guys complain about this case.

    Can the necessary changes be made in the gulp configuration? If there is no such change in the plan, we would like to do it ourselves. What kind of changes should we make for this in the gulpfile.js?



    Posts: 2700
    Support Staff Reply #18178

    Hi ­čÖé

    We have many 3rd party plugins included in the bundle compilation.

    1) You can reduce the compilation time and remove unnecessary 3rd party plugins from bundle config in tools/conf/default.json.

    2) You can set only 1 demo assets to compile. Please check tools/conf/default.json at node config.demo = ‘demo2’

    3) Use command “gulp” without “–prod”, and disable minification setting from tools/conf/default.json.

    4) Using command “gulp” will do clean previous compiled assets. You can try to use to “gulp build-bundle” to skip cleaning task. Existing assets file will be overwritten without removing all previous assets.



You must be logged in to reply to this topic.