-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manifest keys contain source path #238
Comments
This map function seems to have resolved the issue and can be used as a temporary fix:
|
@bigskillet where exactly did you put that map? |
@andrewmcodes, here's my setup:
|
@bigskillet That fix seems to be for a separate issue where the hashes were in the keys. That Here's is what I am using for the time being. new WebpackManifestPlugin({
basePath: `dist/`,
publicPath: `dist/`,
map: f => ({ ...f, name: f.path.replace(/\.[a-f0-9]{32}\./, '.') }),
}), |
@coreyworrell, I'm glad you chimed in, which gave me another look at this. I thought the addition of the map fixed my issue, but I removed the map and it's working correctly right out of the box now. I'm going to chalk it up to user error on my end. I'm not sure what changed or what I was doing wrong before, but I blame the holidays when I originally posted this issue. I'm going to close this since it's a non-issue. |
@bigskillet oh that’s weird. I’m still experiencing the issue here, if I remove the map function then the source path still shows in the key. |
@coreyworrell, weird! I was testing with JS and CSS files only, but I just added a copied image and I see that the src path is still being included:
I added the map back in, but it's still adding the /src/images/ path to the copied image key, as you can see above. So maybe that's not the solution either! I'm going to reopen this, sigh... |
Exactly what I'm experiencing as well. The main entries are fine, but other Asset Module files and assets are including the source path. Using the |
Yeah and the map I was using before isn't working for me anymore. I tried using your version, which removes the src path, but it also adds the hash to the key, which I don't want.
I've tried using your map in combination with |
Looks like your hashes are only 8 characters, so just change the |
@coreyworrell, that's not working for me. I can set it to
Changing your version to
|
Oh sorry @bigskillet, I was using format Just change that first map: f => ({ ...f, name: f.path.replace(/-[a-f0-9]{8}\./, '.') }), |
@coreyworrell, thanks, that worked! |
Hey all, is this still an issue or is there a good workaround in place? |
@shellscape, yes, still an issue. We're having to use the map filter as a workaround:
|
OK thanks. If anyone would like to open a PR to fix this, it would be welcome. |
@bigskillet You also need to make sure any versioning is disabled or the file-loader [hash] isn't in use in the pipeline. To get right of "31d6cfe0" which is [hash:8] and used for cache busting. |
Hi! I may have fixed this on #249 - there are details on how to test at the bottom :). |
Any news about the fix and when the #249 will be merged? |
@yoriiis if you don't see any updates on the pull requests or issues, there is no news. I'll never understand why people ask this on GitHub when everything is available to see. please refrain from replies like this in this repo, as it just adds to noise. |
Hello, after upgrading to webpack 5, I have problem with combination of Problem:
instead of
☝️ This was not problem before, with webpack 4. Any idea what I am doing wrong? Also... Config: new WebpackManifestPlugin({
publicPath: 'assets/',
// https://github.com/shellscape/webpack-manifest-plugin/issues/238
map: (f) => {
console.log(
f.name,
// this replace somehow fixes it...
f.name.replace(
'node_modules/@some-vendor/ui/dist/images',
'ui-images'
)
)
return f;
},
}),
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(
__dirname,
'../node_modules/@some-vendor/ui/dist/images'
),
to: path.resolve(__dirname, '../../backend/www/assets') + '/ui-images',
},
],
}), |
This works for me, but I have to use the
|
I've tried yours and other versions of I had to modify that 'node_modules/@some-vendor/ui/dist/images/icon-to-top.svg'.replace(/.[a-f0-9]{8}/, '')
// bad
"node_modules/@some-vendor/ui/dist/images/icon-to-top.svg" So instead I'm doing it in less generic way: 'node_modules/@some-vendor/ui/dist/images/icon-to-top.svg'.replace('node_modules/@some-vendor/ui/dist/images', 'ui-images')
// good
'ui-images/icon-to-top.svg' Anyway, I'd rather not use |
Expected Behavior
Actual Behavior
Additional Information
The manifest plugin is adding the source path the entry key. For example,
/src/assets/static/
is being added to the copied static font file. It's not adding the source path to the main.css and main.js keys though. I had to add abasePath
to get them matching, which caused the test.png key to double the/assets/
path and also added it to the index.html key. If I remove thebasePath
, the main entries don't match up:"main.css": "/assets/main-fed4ead9.css"
"main.js": "/assets/main-31d6cfe0.js"
Sorry, I'm a bit of n00b, so I'm not sure if this is a bug, feature, or if I'm just using it wrong.
Thanks!
The text was updated successfully, but these errors were encountered: