var path = require('path') module.exports = { build: { // production(生產) 環境 env: require('./prod.env'), // 使用 config/prod.env.js 中定義的編譯環境 index: path.resolve(__dirname, '../dist/index.html'), // 編譯輸入的 index.html 文件 assetsRoot: path.resolve(__dirname, '../dist'), // 編譯輸出的靜態資源路徑 assetsSubDirectory: 'static', // 編譯輸出的二級目錄 assetsPublicPath: '/', // 編譯發布的根目錄,可配置為資源服務器域名或 CDN 域名 productionSourceMap: true, // 是否開啟 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: false, // 是否開啟 gzip productionGzipExtensions: ['js', 'css'] // 需要使用 gzip 壓縮的文件擴展名 }, dev: { // dev(開發) 環境 env: require('./dev.env'), // 使用 config/dev.env.js 中定義的編譯環境 port: 8080, // 運行測試頁面的端口 assetsSubDirectory: 'static', // 編譯輸出的二級目錄 assetsPublicPath: '/', // 編譯發布的根目錄,可配置為資源服務器域名或 CDN 域名 proxyTable: {}, // 需要 proxyTable 代理的接口(可跨域) // 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
autoOpenBrowser: true, // 自動打開瀏覽器
} }
var path = require('path')
module.exports = { build: { // production 環境 env: require('./prod.env'), // 使用 config/prod.env.js 中定義的編譯環境 index: path.resolve(__dirname, '../dist/index.html'), // 編譯輸入的 index.html 文件 assetsRoot: path.resolve(__dirname, '../dist'), // 編譯輸出的靜態資源路徑 assetsSubDirectory: 'static', // 編譯輸出的二級目錄 assetsPublicPath: '/', // 編譯發布的根目錄,可配置為資源服務器域名或 CDN 域名 productionSourceMap: true, // 是否開啟 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: false, // 是否開啟 gzip productionGzipExtensions: ['js', 'css'] // 需要使用 gzip 壓縮的文件擴展名 }, dev: { // dev 環境 env: require('./dev.env'), // 使用 config/dev.env.js 中定義的編譯環境 port: 8080, // 運行測試頁面的端口 assetsSubDirectory: 'static', // 編譯輸出的二級目錄 assetsPublicPath: '/', // 編譯發布的根目錄,可配置為資源服務器域名或 CDN 域名 proxyTable: {}, // 需要 proxyTable 代理的接口(可跨域) // 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 }}