dvinciinteractive / gulp-inject-version Goto Github PK
View Code? Open in Web Editor NEWInject a package version into text based files
Inject a package version into text based files
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)
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!
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.
Hey! Can you please upload the release to NPM? Thanks
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.