Giter Site home page Giter Site logo

Comments (6)

bingnz avatar bingnz commented on August 12, 2024

Hi Daniel,
Does the Less compiler itself fail as well, or just gulp-less-changed? I think I deliberately made the plugin swallow errors otherwise they both report the same problem; the idea being that if the Less doesn't compile then Less itself should tell you. If it's just the plugin, can you find a minimal reproduction of the bug?

from gulp-less-changed.

danielcardoso5 avatar danielcardoso5 commented on August 12, 2024

Hi David,
the less compiler doesn't fail, I think that since gulp-less-changed doesn't throw an error, the file with errors doesn't get passed through the less compiler. That's happening because the error is on an imported file, if the error is on one of the files that gets compiled it gets passed through.
Since the imported file has errors it's not being sent to the less pipeline in order for less compiler to throw an error.

from gulp-less-changed.

bingnz avatar bingnz commented on August 12, 2024

Imported files don't normally get passed through the pipeline by themselves anyway though; they are read in by the less compiler because they're imported into files that do go through the pipeline. If there's an error then less should fail even in the absence of gulp-less-changed.
The result of an error in processing an import with an error should be that the file is always considered to have changed by gulp-less-changed.
So the question is, do you get the error even if gulp-less-changed is out of the picture? If you don't, then gulp-less-changed needs to be fixed. If you do, I'm not sure what behaviour you're expecting. What I would expect is that less fails to compile the file if there's a bug in the import and that gulp-less-changed will always behave as if the file has changed (in other words it'll try and compile every time even if you haven't changed any files). In this case it logs an error to the output and carries on because less itself should fail and allow you to catch the error later on.
It might help if you have an example I can look at?

from gulp-less-changed.

danielcardoso5 avatar danielcardoso5 commented on August 12, 2024

Hi David, yes, imported files don't get passed through, but if they have an error, the file that contains that import is not getting through the pipeline. If I remove gulp-less-changed then gulp-less catches the error. What happens is that gulp-less-changed is not allowing the file that has imports with errors to pass through, at least in my build. I'll leave here some part of the code of my task, I can then setup a small example for you to test.

gulp
      .src(paths.less_to_compile, { allowEmpty: true })
      .pipe(
        lessChanged({
          getOutputFileName: function(file) {
            return ren(file, {
              dirname: paths.build,
              extname: ".css"
            });
          }
        })
      )
      .pipe(
        print(function(filepath) {
          return "Changed LESS: " + filepath;
        })
      )
      .pipe(
        less({
          modifyVars: {
            "static-root": '"' + args.staticRoot + '"'
          }
        })
      )

My paths.less_to_compile is just an array of less files that are basically files that contain imports.
If one of the imports in one of those files has an error, I'm not getting the print after the gulp-less-changed part, which means that gulp-less-changed didn't allow the file to go through.

from gulp-less-changed.

bingnz avatar bingnz commented on August 12, 2024

Hi @danielcardoso5, I thought I'd take a look at this since I hadn't seen your repro and I think I know what you meant. I'm going to release a change so that errors that occur when processing imports are propagated. This might have some side effects for other users of this plugin and if it does I might have to be more specific about which errors are propagated.

from gulp-less-changed.

bingnz avatar bingnz commented on August 12, 2024

🎉 This issue has been resolved in version 1.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

from gulp-less-changed.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.