Compressed and packaged

Compress bundle.js

1. Change the code of our project from es6 -> es5 [babel]
    Reference: http://babeljs.io/docs/setup/#installation
    
    1.1. Install package babel-core babel-loader babel-preset-env
    
    1.2, configure in the loader
        see code
    
    1.3. Create a .babelrc configuration file in the root directory of the project and write the presets code
        see code

2. Set it up as a production environment
    Reference: https://cn.vuejs.org/v2/guide/deployment.html
    
3. Compression
    Reference: https://cn.vuejs.org/v2/guide/deployment.html

Compress index.html

https://github.com/jantimon/html-webpack-plugin

Installed third-party packages

包:babel-core babel-loader babel-preset-env
    Reference scene: Convert the code in our project to es5 code
    Installation method: cnpm i babel-core babel-loader babel-preset-env -D

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325150889&siteId=291194637