Git Product home page Git Product logo

Comments (4)

juanghurtado avatar juanghurtado commented on August 17, 2024

Well, it is not a bug, is a "feature" of replace(). It seems that $& is a special character that is used to use the searched string into the substitution string (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace).

I'm trying to see how to solve it. An easy fix would be to use something like str = str.split(match).join(replaceWith);. Not efficient, but would work.

from gulp-include.

juanghurtado avatar juanghurtado commented on August 17, 2024

I have sent #5 with this fix. If you find something better, please forget my code 😄

I'll leave this issue opened until a decision has been made.

from gulp-include.

wiledal avatar wiledal commented on August 17, 2024

Ha! Good catch. That's very odd indeed.

One note on your gulpfile, you only need to run include() once:

gulp.src("app.coffee")
    .pipe(include())
    .pipe(coffee())

Since the javascript is within the backsticks the coffeescript compiler will not touch it.

Edit: I see now that you probably are doing this approach due to the bower-implementation having backticks... That's a shame...

from gulp-include.

juanghurtado avatar juanghurtado commented on August 17, 2024

That's right, Bower jQuery version has comments with backticks, that's why I have to do the includeCoffee-CompileCoffee-IncludeJS process 😉

Closing this issue now since #5 has been merged.

from gulp-include.

Related Issues (20)

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.