javascript - How does webpack replace all html in src into build?
世界只因有你2017-06-12 09:28:43
0
3
732
For example, there are a.html, b.html, c.html... in src. After I modify the html file in src, how do I replace it in the build folder? Build is online and src is development
What you mean is not very clear If you just want to put the html files in the build folder, you can install copy-webpack-plugin to copy these files. Of course, you can also use nodejs to run shell copy. At this time Using shelljs is a good solution.
If you want to have multiple entries, you need to configure it in html-webpack-plugin. For specific configuration methods, please refer to the linked document
What you mean is not very clear
If you just want to put the html files in the build folder, you can install copy-webpack-plugin to copy these files. Of course, you can also use nodejs to run shell copy. At this time Using shelljs is a good solution.
If you want to have multiple entries, you need to configure it in html-webpack-plugin. For specific configuration methods, please refer to the linked document
What you described is not very understandable
If you just want to replace files, then just write a script
Wouldn’t it be enough to just write a script in python or node?.