Config/index.js

Source: Internet
Author: User

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

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.