M
M
myskypesla2016-05-12 20:43:22
JavaScript
myskypesla, 2016-05-12 20:43:22

How to change file paths with variables in gulp?

How to change a variable using GulpJs?
Let's say we have the following structure:
src
----img
--------img1.png
----css
--------main.css
----index.html
and paths to index. html are written like this:
<style src="css/main.css"></style>
Paths in css to the image are written like this:

body {
    background-image: url(../img/img1.png);
}

And when building a project using gulpjs, I need the paths to be replaced with the following:
<style src="user/assets/css/main.css"></style>
body {
    background-image: url(user/assets/img/img1.png);
}

Is it possible to implement this without a structure device in the src folder, and so that the old paths remain in src, and files with new paths go to public?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Makarov, 2016-05-12
@rmakarov

intercept the stream and change the file as you please.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question