Code Monkey home page Code Monkey logo

gulp-inject-version's People

Contributors

clickermonkey avatar jaaulde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gulp-inject-version's Issues

Only first occurrence is replaced

if I have:

var a = "%%GULP_INJECT_VERSION%%";
var b = "%%GULP_INJECT_VERSION%%";

after building I get:

var a = "v1.0.0";
var b = "%%GULP_INJECT_VERSION%%";

This is due to the replace() function used only replacing the first occurrence.

I workaround at the moment by doing this in my Gulpfile:

.pipe(injectVersion({
              replace: /%%GULP_INJECT_VERSION%%/g
        }))

which is a bit ugly. Would it be possible to add an option to 'replaceall' pls?

(Also, great package!, thanks for contributing this)

Inject version into app.js?

Hi! I am using gulp and would like to add the 'version' at a method inside the app.js.

Something like this:

version() {
return '%%GULP_INJECT_VERSION%%'
}

This does not work, what would a workaround be to achieve the goal?

Thanks!

Error: package.json not valid JSON

I am trying to run gulp inject version after I run gulp bump but I keep getting the error invalid json, but if I run this individually they run fine. Please can you help me fix this.

Cannot use `prepend` option with empty string

If I use the prepend option with an empty string '', it gets ignored. That's because in JavaScript empty strings are evaluated to false. You'd have to change the code to check against undefined value or use '' as default.

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.