See Http://vuejs-templates.github.io/webpack for documentation.
var path = require (' path ')
Module.exports = {
//configuration used when building the product
Build: {
//webpack compilation Environment
Env:require ('./prod.env '),
//Compile the input index.html file
Index:path.resolve (__dirname, ' ... /dist/index.html '),
///Webpack destination folder path for output
AssetsRoot:path.resolve (__dirname, ' ... /dist '),
//Webpack Two-level folder for compiled output
Assetssubdirectory: ' Static ',
//Webpack publishing path for compiled output
Assetspublicpath: '/',
//Use Sourcemap
Productionsourcemap:true,
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
//Open gzip mode is not turned on by default
Productiongzip:false,
extensions for files that need to be compressed in//gzip mode
Productiongzipextensions: [' 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 off
BundleAnalyzerReport:process.env.npm_config_report
},
//configuration used in the development process
Dev: {
//webpack compilation Environment
Env:require ('./dev.env '),
//dev-server listening port
port:8080,
//automatically opens the browser
Dev-server after starting Autoopenbrowser:true,
Span style= "COLOR: #ff0000" >//Webpack compiled output two-level folder
Assetssubdirectory: ' Static ',
//request proxy table, Here you can configure a specific request proxy to the corresponding API interface
//for example '/api/xxx ' proxy to ' www.example.com/api/xxx '
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.
//Whether to open Csssourcemap
Csssourcemap:false
}
}
Config/index.js