gulp-replace | A string replace plugin for gulp | Plugin library
kandi X-RAY | gulp-replace Summary
kandi X-RAY | gulp-replace Summary
A string replace plugin for gulp
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- do the replacement
- replace file contents
gulp-replace Key Features
gulp-replace Examples and Code Snippets
Community Discussions
Trending Discussions on gulp-replace
QUESTION
I have just upgraded to gulp4 and now I am getting this error. From reading reports on this error I need to change the gulp.task("prod", function (callback) {
and add this gulp.series
. Is that correct?
Error
...ANSWER
Answered 2022-Apr-08 at 20:05It seems that runSequence
was designed for Gulp 3. In Gulp 4, you can use the built-in gulp.series
instead.
For your "prod" task:
QUESTION
I have a gulp build, everything works fine, but after the build, some images are not loaded and are not displayed because the paths are different, for this I installed gulp-replace. The paths have been successfully replaced, this can be seen in the final code. But the image is not showing on the page.
And every time when I start the assembly, the picture that was missing may appear in the new assembly, but another one will be missing
What's wrong with my build?
...ANSWER
Answered 2022-Jan-22 at 18:40The problem was in const cleanCSS = require("gulp-clean-css");
As I did not try to rearrange the line with renaming, nothing happened. In the minified file, the paths remain from the src parp. Temporarily removed minification
QUESTION
I'm using gulp-replace to modify static html.
The search and text values are stored in an array:
...ANSWER
Answered 2021-Oct-24 at 00:44Solution
This may not be the tightest code, but it seems to work:
QUESTION
After I run npm start
This is my result is ...
...ANSWER
Answered 2021-Oct-01 at 17:24chnage the .js
file to
QUESTION
So, I have 1 error in my GULP when I use the following:
...ANSWER
Answered 2021-Aug-04 at 13:43I found the answer here with this article!
This is EXACTLY what I needed and the results are PERFECT!
QUESTION
I want to install a list of packages from a simple text file (yes, package.json is what this was designed for)
my first approach was this:
npm i $(cat builder-dev-packages.txt) -g
similar to this: docker rm $(docker ps -a -f status=exited -q)
But I'm still getting that command evaluated as an invalid tag name.
npm ERR! code EINVALIDTAGNAME ": Tags may not have any characters that encodeURIComponent encodes.
Do I need to run through my npm command with a while loop instead of evaluating the output of a cat
statement? This script still provides the same error for each line in the txt file.
ANSWER
Answered 2021-Feb-26 at 19:54npm install
accept a list of packages delimited by space, but you are passing it a list of packages delimited with new line, this is why you experience issues.
try the following
QUESTION
Just went back to a very old project and updated to Gulp 4.0.2.
Managed to get it watching and compiling css, but doesn't seem to watch changes to the JavaScript files?
It doesn't throw any errors, just doesn't compile the JS when I make a change.
(I'm a designer and my JS is terrible, so you might have to really spell it out for me 😬)
gulpfile.js
...ANSWER
Answered 2021-Jan-05 at 09:24paths.scripts.src + '/*.js'
and paths.vendor.src + '/*.js'
contained an extra /
Thanks to Thomas Sablik
QUESTION
]*alt="([^"]*))(?=[^>]*src="([^"]*)).*\/>
...ANSWER
Answered 2020-May-26 at 23:24Use $
.
/\k/
is for the regex itself, ?P
for Python syntax.
QUESTION
Am trying to run gulp commands from package.json. But unable to execute.
This is my package.json.
...ANSWER
Answered 2020-May-06 at 10:12I resolved by modifying srcipt section by adding "locale-sass"
and in lint-staged
npm run gulp locale-sass
instead of gulp locale-sass
QUESTION
I am looking for a safe way of doing require aliases using gulp. The idea is similar to what webpack offers with resolve alias.
For example, I put on my source code something like require('@plugin/utils')
and it is translated to something of my choice, like require('$/plugins/longer/namespace/utils')
. You probably have noticed that it does not match to any actual file path, and that is intentional (they are tiddlywiki files if anyone is interested).
The best thing I found is gulp-replace, but that relies on strings replacements at worst and regular expressions at best.
Ideally I would want something more reliable, something that is AST aware,so I'm sure that I never replace the wrong string (for example, a template string).
I am also using babel, so if there is a babel plugin that I can use I will also be happy about that.
As a last resort I may try to write some babel plugin or a gulp plugin using esprima, but esprima is not up to modern JS standard (doesn't parse object spread) and I would prefer creating another tool.
Thanks in advance
...ANSWER
Answered 2020-Apr-26 at 11:28Finally I found a babel module (babel-plugin-module-resolver) that I can integrate with gulp, and with some extra configuration magic with eslint.
So, this is what I added to my gulp pipeline (simplified)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gulp-replace
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page