Hey so I have the following config (in rollup):
postcss({
to: './public/dist/',
extract: 'public/dist/app.css',
plugins: [
url({
url: 'copy',
useHash: true,
assetsPath: './dist/',
})
]
})
And the following CSS:
.hero {
background-image: url("../images/hero.jpg");
}
Which is the closest I can get it to working, the image is in the right directory public/dist however the CSS path is background-image: url("dist/7d8c51c4.jpg");
This resolves to http://localhost/dist/dist/7d8c51c4.jpg as opposed to http://localhost/dist/7d8c51c4.jpg.
I am running a server in the public/ directory and essentially need the path to be /dist/7d8c51c4.jpg or alternatively ./7d8c51c4.jpg as the image is in the same root as the generated CSS file.
I have tried every possible variation I can think of with the to and assetPath arguments, but I either get the path right and the image in the wrong directory or the image in the right directory and the wrong path.
Cheers.
Hey so I have the following config (in
rollup):And the following CSS:
Which is the closest I can get it to working, the image is in the right directory
public/disthowever the CSS path isbackground-image: url("dist/7d8c51c4.jpg");This resolves to
http://localhost/dist/dist/7d8c51c4.jpgas opposed tohttp://localhost/dist/7d8c51c4.jpg.I am running a server in the
public/directory and essentially need the path to be/dist/7d8c51c4.jpgor alternatively./7d8c51c4.jpgas the image is in the same root as the generated CSS file.I have tried every possible variation I can think of with the
toandassetPatharguments, but I either get the path right and the image in the wrong directory or the image in the right directory and the wrong path.Cheers.