VUE-CLI Scaffolding NPM Related file description (9) config/index.js

Source: Internet
Author: User

Series of articles Portal:

1, Build/webpack.base.conf.js

2, Build/webpack.prod.conf.js

3, Build/webpack.dev.conf.js

4, Build/utils.js

5, Build/vue-loader.conf.js

6, Build/build.js

7, Build/dev-server.js

8, Build/check-versions.js

9 、.. /config/index.js

The following is a description of the relevant code and configuration in Config/index.js

//See Http://vuejs-templates.github.io/webpack for documentation.varPath = require (' path ') Module.exports={build: {Env:require ('./prod.env '),    //relative path splicing, if the current and Directory is config, then the following configuration of the Index property value is dist/index.htmlIndex:path.resolve (__dirname, ' ... /dist/index.html '),//Index pageAssetsRoot:path.resolve (__dirname, ' ... /dist '),//Output DirectoryAssetssubdirectory: ' Static ',//Sub-directoriesAssetspublicpath: '/',//The publishing address, such as the HTML reference JS, is the/startProductionsourcemap:true,//whether to turn on Sourcemap    //Gzip off by default as many popular static hosts such as    //Surge or netlify already gzip all static assets for you.    //before setting to ' true ', make sure to:    //npm Install--save-dev compression-webpack-pluginProductiongzip:false,//whether to turn on gzip and what types of files are includedProductiongzipextensions: [' js ', ' CSS '],    //Run The build command with a extra argument to    //View The Bundle Analyzer report after build finishes:    //' npm Run build--report '    //Set to ' true ' or ' false ' to always turn it on or offBundleAnalyzerReport:process.env.npm_config_report//Build report when executing ' NPM run build--report '}, Dev: {env:require ('./dev.env '), Port:8080, Autoopenbrowser:true, Assetssubdirectory:' Static ', Assetspublicpath:‘/‘,    /** * Typical direction proxy configuration proxytable: {'/appname ': {target: ' http://api.appName.com ', destination URL address Changeorigin:true, indicates whether cross-domain pathrewrite: {' ^/appname ': ' Replace content ', make request/appname equivalent to Api.appname . com/replace Content}}}*/proxytable: {},//CSS sourcemaps off by default because relative paths is "buggy"    //with this option, according to the Css-loader README    //(https://github.com/webpack/css-loader#sourcemaps)    //In We experience, they generally work as expected,    //just is aware of this issue when enabling this option.Csssourcemap:false  }}

Reference: http://www.cnblogs.com/ye-hcj/archive/2017/06.html

VUE-CLI Scaffolding NPM Related file description (9) config/index.js

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.