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