var path = require (' path ') Module.exports = {build: {///Production Environment Env:require ('./prod.env '),//Use CONFI The compilation environment defined in G/prod.env.js index:path.resolve (__dirname, '. /dist/index.html '),//Compile the input index.html file assetsRoot:path.resolve (__dirname, '. /dist '),//Compile output static resource path assetssubdirectory: ' Static ',///compile output of level two directory Assetspublicpath: '/',///compile the root of the publication, can be configured as a resource server domain Name or CDN domain name productionsourcemap:true,//whether to turn on Csssourcemap//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-plugin PRODUCTIONGZIP:FA LSE,//whether to open gzip productiongzipextensions: [' js ', ' CSS ']//need to use gzip compressed file extension}, Dev: {//dev environment Env:requi Re ('./dev.env '),//use port:8080 defined in Config/dev.env.js,//Port to run test page assetssubdirectory: ' Static ',//compile output of two Level directory Assetspublicpath: '/',//compile the published root directory, configurable asSource server domain name or CDN domain name proxytable: {},//interface requiring proxytable proxy (cross-domain)//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#sou RCEMAPS)//experience, they generally work as expected,//Just is aware of this issue when enabling this Option. Csssourcemap:false//whether to open Csssourcemap}}
Vue-cli webpack config index.js configuration note