【webpack】config/index.js

來源:互聯網
上載者:User

標籤:ted   conf   loader   .com   because   輸出   web   etl   代理   

 

// see http://vuejs-templates.github.io/webpack for documentation.var path = require(‘path‘)module.exports = {  build: {// 構建產品時使用的配置    env: require(‘./prod.env‘),// webpack的編譯環境    index: path.resolve(__dirname, ‘../dist/index.html‘),// 編譯輸入的index.html檔案    assetsRoot: path.resolve(__dirname, ‘../dist‘),// webpack輸出的目標檔案夾路徑    assetsSubDirectory: ‘static‘,// webpack編譯輸出的二級檔案夾    assetsPublicPath: ‘/‘,// webpack編譯輸出的發布路徑    productionSourceMap: true,// 使用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-plugin    productionGzip: false,// 預設不開啟開啟gzip模式    productionGzipExtensions: [‘js‘, ‘css‘],// gzip模式下需要壓縮的檔案的副檔名    port: 9000  },  dev: {// 開發過程中使用的配置    env: require(‘./dev.env‘),// webpack的編譯環境    port: 8080,// dev-server監聽的連接埠    assetsSubDirectory: ‘static‘,    assetsPublicPath: ‘/‘,    proxyTable: {},// 請求代理表,在這裡可以配置特定的請求代理到對應的API介面    // CSS Sourcemaps off by default because relative paths are "buggy"    // with this option, according to the CSS-Loader README    // (https://github.com/webpack/css-loader#sourcemaps)    // In our experience, they generally work as expected,    // just be aware of this issue when enabling this option.    cssSourceMap: false  // 是否開啟 cssSourceMap  }}

 

【webpack】config/index.js

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.