Vue-cli webpack Config index.js configuration notes

Source: Internet
Author: User

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

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.