-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
feat: add support for target path transforms (options.transformPath
)
#115
Conversation
options.transformPath
)
@patkec Could you please rebase to latest |
Rebased. As for the implementation, the only option that would be suitable is |
options.transformPath
)options.transformPath
)
Can you give a small example for |
It seemed like a good idea at the time, but cannot really think of a good example right now. Will think about it over the weekend and get back to you. |
Thinking a bit about this, the only benefit of having both templates and a transform is that templates support content hashing. Everything else should be fairly easy to implement in the transform function, if needed. |
4042438
to
aff71ee
Compare
@evilebottnawi We should find consensus on this if possible. I'm -0 atm |
If you want, I can provide an example usage for this. Let's say I want to copy all of my html files to my dist folder. When I do this currently: new CopyWebpackPlugin([
{ from: 'src/*.html',
to: './'
], { debug: 'info' }) This will make a new folder in new CopyWebpackPlugin([
{ from: 'src/*.html',
to: './',
transform: function(content, filePath) {
return path.resolve(filePath, '..');
} }
], { debug: 'info' }) But currently this does not work since we can't transform the path of a file, YET. |
Any idea when this will be released? |
Need rebase |
Close in favor #284 |
Added a new function,
transformPath
, with which the target path can be modified programmatically. Decided to keep the functionality ofto
param unmodified so that path transfformation can be combined with templates for ease of use.Should resolve #107.