const path = require('path') module.exports = { publicPath: './', // vueConf.baseUrl, // 根域上下文目錄 // outputDir: 'dist', // 構建輸出目錄 // assetsDir: 'assets', // 靜態資源目錄 (js, css, img, fonts) lintOnSave: true, // 是否開啟eslint保存檢測,有效值:ture | false | 'error' // runtimeCompiler: true, // 運行時版本是否需要編譯 transpileDependencies: [], // 默認babel-loader忽略mode_modules,這里可增加例外的依賴包名 productionSourceMap: false, // 是否在構建生產包時生成 sourceMap 文件,false將提高構建速度 css: { // 配置高於chainWebpack中關於css loader的配置 // modules: true, // 是否開啟支持‘foo.module.css’樣式 // extract: true, // 是否使用css分離插件 ExtractTextPlugin,采用獨立樣式文件載入,不采用<style>方式內聯至html文件中 // sourceMap: false, // 是否在構建樣式地圖,false將提高構建速度 loaderOptions: { // css預設器配置項 // less: { // loaderOptions: { // data: `@import "@/assets/less/global.less";` // } // } } }, parallel: require('os').cpus().length > 1, // 構建時開啟多進程處理babel編譯 pluginOptions: { 'style-resources-loader': { preProcessor: 'less', patterns: [path.resolve(__dirname, './src/assets/less/global.less')] } }, pwa: { // 單頁插件相關配置 https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa }, devServer: { open: true, host: '0.0.0.0', port: 8081, https: false, hotOnly: false, // proxy: null proxy: { '/api': { target: '',//請求地址 ws: true, changeOrigin: true, pathRewrite: { '^/api': '' //請求地址
} } } // before: app => {} } }