-
-
Notifications
You must be signed in to change notification settings - Fork 256
output images are in parent folder when useRelativePath option is true #149
Comments
@nopantsmonkey You can't use |
and please add the ``` around the code it's very hard to read atm 😛 |
i 've created a repo for you with the issue Commands
Repo URL: |
@nopantsmonkey kk i will take a look into it soon |
@nopantsmonkey It's a knowed issue. I'm solving this, can you test this version, please? This version seems to work. Can you confirm for me if it working as expected? |
yes @adriancmiranda it is working as expected. |
@nopantsmonkey If #150 contains this, it's likely to land soon :) |
should i close this issue now or you 'll close it after the release of file-loader with #150 EDIT: |
@nopantsmonkey I will close it when #150 lands :) |
@adriancmiranda i think there is some problem between the repo you asked me to verify and the code in #150 images paths using above repo images path with (adriancmiranda/file-loader:master) |
@nopantsmonkey No, that's right, at line 18 we changed the defaults to empty and we also change the line 75. So, we have two ways of dealing with this case. It's likely that you haven't any output at the root of |
it is working for me with |
I am running into similar challenge and no combination of flags seems to fix the issue. My setup is like this:
My
This copies the images directory under the |
@doomsbuster |
I am using |
@doomsbuster I mean, this is the fixed version tested here at this thread. There's no merge for it yet. |
I have the same problem. Here's my temporary solution inspired by #150 (comment) {
test: /\.(png|jpe?g|gif|svgz?)$/i,
include: resolve('src'),
use: [
// Don't emit file here, just override the url below
{
loader: 'file-loader',
options: {
useRelativePath: true,
publicPath: '',
name: '[name].[ext]',
emitFile: false,
},
},
// Just emit file here, the compiled url would be overridden
{
loader: 'file-loader',
options: {
publicPath: '',
context: resolve('src'),
name: `[path][name].[ext]`,
},
},
],
}, It is ugly, but it works |
Option |
|
Uh oh!
There was an error while loading. Please reload this page.
My webpack file
My folder structure
|-
|----build/
|---------css/
|--------------web/
|-------------------home/
|-------------------------style.css
|-------------------app/
|-------------------------app.css
|--------------desktop/
|-----------------desktop.css
|---------images/
|--------------web/
|-------------------home/
|-------------------------image1.jpg
|-------------------app/
|-------------------------image2.jpg
|--------------desktop/
|-------------------------image3.jpg
`
but since i am specifying public path ('../../')
background: url(../../image/desktop/image3.jpg) in my desktop.css are working correctly
but web/home/style.css
background: url(../../image/web/home/image1.jpg) in style.css is not correct (correct path should be ../../../image/desktop/image3.jpg)
then i tried
then the css files are creating correct paths
for desktop background: url(../../image/desktop/image3.jpg)
for web/home background: url(../../image/web/home/image1.jpg)
but images folder is not in build directory
desktop images are in the project's parent folder (../../)
and web/home images in project's parent's parent folder (../../../)
How to create images folder in build/ and have the same paths as with useRelativePath?
The text was updated successfully, but these errors were encountered: