-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
replace in file #65
Comments
Seconding this. I use ReplaceInFileWebpackPlugin today, but I can't get it to execute before the FileManagerPlugin starts |
Saw the plugin, Also I am not so sure about replacing in file, since this happens before and after the compilation. Problem with that is If we are replacing the content of the emitted file after compilation, it will change the contenthash of the files, will then need to find and replace in all of its related assets. |
Thanks for the reply, I understand. Then it seems that there is no real solution if you want to zip the dist after changing some values in it. Do you think it could be possible to add a wait timer, as a workaround? Or a kind of "beforeHook" that would let the user run some logic before executing the onEnd events (which in my case could let me tell the script to sleep for 1s for instance) |
Not sure. can you post what you are trying to achieve? Also I saw the processassets hook in webpack-5, about letting users specify the stage and callback with assets. I am not sure that will help. but I haven't got enough time to evaluate the options. |
I have a few config file in my app with placeholder values, and I use Then I want to zip my whole So it's really an operation that I want to perform once the full build process is over. |
got it. may be if you are using webpack 5 you could use this plugin copy-asset-in-memory-webpack-plugin and tap into a specific stage to do the transform/replace on the code, or use copy-webpack-plugin which also has a transform function (I am not sure that will help your case) Meanwhile I'll see what I can do here. |
Could you add some additional compiler hooks such as |
Hi,
Could you please consider to implent a 'replace in file' action, that would be great.
Thanks :)
The text was updated successfully, but these errors were encountered: