-
-
Notifications
You must be signed in to change notification settings - Fork 183
Copy plugin integration #75
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
Conversation
Add mock of plugin to simulate assets additions from external plugin
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
==========================================
+ Coverage 98.57% 98.71% +0.14%
==========================================
Files 2 2
Lines 70 78 +8
==========================================
+ Hits 69 77 +8
Misses 1 1
Continue to review full report at Codecov.
|
Great thank you, I will have a look at it later Sorry, if it was a bit painful due to all the changes :) |
This is a feature I need – I've tried using this branch in my
... |
@mattandrews Can you double check you have this |
Hi @mastilver – this is what I have:
When I browse the files it installs in |
I think you will have to check with @davidmpaz, I have zero experience with that plugin..., but it's an issue if it doesn't work. |
Would be nice to have some more data to look at. Just tested again the branch and I see no problem. Can you provide requested info @mattandrews ? |
Thanks both – I've set up a simple repo here which shows an issue: https://github.com/mattandrews/webpack-manifest-copy-images-bug A couple of things to note though:
To be honest this issue may be down to my misunderstanding of Webpack (or just a bad workflow I'm trying to create?) rather than an initial bug with this fork – certainly my report above was wrong because I wasn't even using this plugin 😞). |
@mattandrews I'm afraid this can't really be solved... unless you can have access to the |
Hi @mattandrews don't worry too much about it, we all learn new stuff everyday :) Like @mastilver said is a bit complicate because of how copy-plugin works. From my experience, getting files copied with hashed file names for versioning was not working as expected. One thing I did tried was to hash files when copying everything just one level under directory to copy from. That worked fine. Still when trying to use with globs could not make it work, honestly did not look much more deeper later on. Some threads you could read, maybe can help to find a solution regarding versioning copied files:
Regarding manifest plugin, just be sure to add the copy-webpack-plugin before the manifest plugin in order to get all copied files included in the webpack compilation. cheers |
BREAKING CHANGE: add extra keys to manifest when using copy-webpack-plugin closes #75
BREAKING CHANGE: add extra keys to manifest when using copy-webpack-plugin closes #75
BREAKING CHANGE: add extra keys to manifest when using copy-webpack-plugin closes #75
Thank you for your work @davidmpaz :) |
This worked great for me. I needed it to copy django's static files into webpack to get them into my build process and manifest.json Much appreciated! |
Currently on the RC2. Does this also work with hashed filenames? Currently using the CopyWebPackPlugin like this:
Expected output in manifest:
what gets outputted in the manifest:
Am I missing something? |
@Levdbas I'm afraid no... #75 (comment) |
@Levdbas I ended up not using this plugin and used a gulp task to version all my assets at build time (eg. for deployments, not day-to-day development). It simplified things as local development doesn't need versioning, and therefore I didn't need to tell Webpack about a bunch of unrelated files (image assets etc). |
Thanks @mattandrews for your approach. Will consider someting like that as well if this really cant be solved. @mastilver could the guys from copywebpack or any other plugin implement this new hook in such a way that no matter if the filename is hashed or not, it still gets a properly output in the manifest? In that case I will head over to the copywebpack repo to ask :) |
See my webpack-contrib/copy-webpack-plugin#104 (comment) for a working solution using |
Hi @mastilver,
This is the follow up of #45. Unfortunately I will not have more time these days until next week for the project.
I need help here also with these lines, in the function
existAssetInFiles
. From tests I was getting an edge case for files ending in:.hot-update.json
. Currently the solution I found was that you see there. But honestly I dont know from where that comes and whether this is the right way to check if the asset was included already. Please could you take a look and improve from there?Things we can have in mind:
If there is something we could do from copy-webpack-plugin side to make easier that check, I can make a pull request to them. If you look at the mock plugin what it does is asimilar to what copy-webpack-plugin does. Maybe we can add another data there to use later in here to filter easily. Some flag that does not interfere with standard things and so on like:
So in here we can do something like:
Sorry for the long post.
regards