search

Home  >  Q&A  >  body text

A brief discussion on packaging optimization of vue-cli2.0

When modifying assetsPublicPath in build in config/index.js,

found productionSourceMap and productionGzip underneath it.

To put it awkwardly, I really haven’t noticed these two attributes before. Now that I have discovered them, let’s explore them.

With the programming ideas for Google and Baidu, I went to check out the documentation, and then briefly summarized it to facilitate myself to fill in the pits.

productionSourceMap

Whether to enable automatic generation of .map files during packaging, it is recommended to change it to false, so that the packaged size can be reduced a lot.

At the same time, another important point is that when it is true, your source code is exposed.

As long as you open the browser console, you can see it directly in Sources your source code.

Therefore, it is generally recommended to set this attribute to false

## »zip

## whether to open the compression when it is enabled. All are true.

When using this attribute, you need to install compression-webpack-plugin. Dependency

After version 2.0.0, this module requires at least Node v6.9.0 and Webpack v4.0.0

So if it is the webpack3. #
人偶*纵师人偶*纵师690 days ago589

reply all(0)I'll reply

No reply
  • Cancelreply