webpack-encore
                                
                                 webpack-encore copied to clipboard
                                
                                    webpack-encore copied to clipboard
                            
                            
                            
                        fix(copy-files): use context realpath
In scenarios where context is within a symlink, path.relative() will return an undesired path because the resource path follows symlinks. We resolve this by using fs.realpathSync(options.context).
don't you need to do this both for the resource path and the content though ?
In my testing, which was not very extensive at all, the symlink had already been followed for the resourcePath. I didn't investigate where it gets it, though, or if there are any caveats.
At any rate, I can do the same for the resource path too if you want.
Could you maybe add some functional tests using symlinks?
Yes, this would be great! It can be added in this section - probably we could just create a symlink at the start of the test, make sure that file is copied, then clean up the symlink after. Can you try that @QWp6t?
Thanks!
https://github.com/symfony/webpack-encore/blob/master/test/functional.js#L1753
Hey guys, just wanted to stop by to mention I haven't forgotten about this PR. Yes, I can add some tests, but I have a deadline coming up, so it'll have to wait a bit. I think you guys have access to push to my fork if you're wanting to fast-track this for whatever reason, otherwise I'll make the changes you requested just as soon as I'm finished with work, probably end of next week.
Have a good week! 🍻