webpack add custom package file

Later, his colleagues found that a simpler way, using the built-in plug-CopyWebpackPlugin webpack

Change the package configuration file:

 

 

 

As the company released the front end of the project need to fight image package, the package will be packaged static files and ngix.conf, entry.sh, dockerfile and other documents together into a single archive uploaded to the cloud platform, as shown below

Therefore we need to transform webpack packaged logic;

In fact webpack is node.js applications in the project to build this piece, therefore, to achieve this requirement, node.js only need to have some understanding can be.

First change packaged in config / index.js path (to add a child directory info)

Build.js and then copy the files related to the appropriate directory Nginx can, when webpack packaged, packed files in the directory will delete operation, so if you want to file packaged in the same directory, you should build. js end of the logical add copy

Finally, the resulting directory structure

Published 243 original articles · won praise 36 · Views 140,000 +

Guess you like

Origin blog.csdn.net/A873054267/article/details/103924845