Closed onigoetz closed 8 years ago
Hi @onigoetz! Let's see how can we resolve this.
Why don't you convert SVGs to the src/main/frontend/images
?
Hi @borodean
Yes, I could do that, but I wanted a clear separation between sources and generated files.
Hi,
I have a similar problem, so I had to revert to version 3.0.3.
I am minifying PNG, JPEG, GIF and SVG images with gulp-imagemin, thus moving them from one folder to another. My folder structure is slightly different:
/
gulpfile.js
/client/
/css
/img
/build
/css
/img
These are the plugin options:
assets({
basePath: 'build/',
relativeTo: 'build/css', loadPaths: ['img', 'fonts'],
cachebuster: true
})
P.S. Thanks for the great plugin, @borodean.
@vladimirsiljkovic 4.1.0 is now capable of receiving a string as relative
option value. If a string is provided, generated paths would be relative to a path described in it.
Thank you very much, @borodean!
Just to confirm that it works correctly.
I've changed my options to:
assets({
basePath: 'build/',
relative: 'css',
loadPaths: ['img', 'fonts'],
cachebuster: true
})
@vladimirsiljkovic true, it works absolutely the same as relativeTo
worked. Let me now if something goes not as expected.
Thank you that's perfect :D
Hi,
I'm sorry to have to make an issue to ask for a removed feature, but I have a use case were it worked perfectly and I can't get the new way to work.
My environment
frontend-maven-plugin
with gulpgulp-svg2png
to create png's out of all my svg'sMy current configuration
So the following css :
.Image1 { background: resolve('image.png'); }
compiles to.Image1 { background: url('../images/image.png'); }
Updating to 4.0
If I update to 4.0 and update my configuration to
now, the same css (
.Image1 { background: resolve('image.png'); }
will compile to.Image1 { background: url('../../webapp/resources/images/image.png'); }
While you could say, that I can change
loadPaths
toloadPaths: ["images"],
this will work for almost all files, but not for svg files converted to png, because they don't exist insrc/main/frontend/images
.Do you have an idea how I can support that use case in my project ?