Vuecli3 Changes the package folder name and file name

requirements

Change the name of the relevant content in static when the VUE project is packaged

Normal packing condition

The solution

1. Modify the JS file content. The following configuration can modify the JS folder and js file content

2, modify CSS, a little trouble

The first method: mini-CSS-extract-plugin

Introducing plug-ins:

The disadvantage is that the default packaged CSS file still exists. In this case, it is unreasonable to generate two CSS packaged files.

const MiniCssExtractPlugin = require(“mini-css-extract-plugin”);

Reference article:

1, mini – CSS – extract – the plugin’s brief introduction: www.cnblogs.com/blackgan/p/…

2, Mini-CSS-extract-Plugin source code: blog.csdn.net/vv_bug/arti…

3, www.npmjs.com/package/min…

4, www.cnblogs.com/skychx/p/we…

The second method: the chainWebpack property

Disadvantages:

If this attribute is configured directly, the following error is reported:

Error: Cannot call.tap () on a plugin that has not yet been defined. Call plugin(' HTML ').use(< plugin)Copy the code

Or:

Reference article:

1, cli.vuejs.org/zh/guide/ht…

2, blog.csdn.net/lyn17726719…

3, www.jianshu.com/p/b358a91bd…

conclusion

Method is always more than difficult, from today to learn WebPCAK, before basically a little, day.