| | |
| | | const { defineConfig } = require('@vue/cli-service') |
| | | const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); |
| | | const path = require('path'); |
| | | const TITLE = process.env.VUE_APP_TITLE |
| | | const scss_path = `@/assets/theme/index.scss` |
| | | const { defineConfig } = require("@vue/cli-service"); |
| | | const NodePolyfillPlugin = require("node-polyfill-webpack-plugin"); |
| | | const path = require("path"); |
| | | const TITLE = process.env.VUE_APP_TITLE; |
| | | const scss_path = `@/assets/theme/index.scss`; |
| | | |
| | | module.exports = defineConfig({ |
| | | transpileDependencies: true, |
| | | lintOnSave: false, |
| | | productionSourceMap: false, |
| | | configureWebpack: config => { |
| | | config.output.filename = `js/[name].[contenthash].js`, |
| | | config.output.chunkFilename = `js/[name].[contenthash].js`, |
| | | config.plugins.push(new NodePolyfillPlugin()) |
| | | configureWebpack: (config) => { |
| | | (config.output.filename = `js/[name].[contenthash].js`), |
| | | (config.output.chunkFilename = `js/[name].[contenthash].js`), |
| | | config.plugins.push(new NodePolyfillPlugin()); |
| | | }, |
| | | //publicPath: './', //打包APP用,打包时,需要隐藏首页连接钱包按钮和授权按钮 |
| | | publicPath: '/wap/', // H5网页用,默认展示:连接钱包和授权按钮的。 |
| | | publicPath: "/wap/", // H5网页用,默认展示:连接钱包和授权按钮的。 |
| | | //publicPath: '/wod/', //苹果免签包H5网页用,打包时,需要隐藏首页连接钱包按钮和授权按钮 |
| | | outputDir: 'dist', |
| | | assetsDir: '', |
| | | chainWebpack: config => { |
| | | config.plugin('html') |
| | | .tap(args => { |
| | | args[0].title = TITLE |
| | | return args |
| | | }) |
| | | outputDir: "dist", |
| | | assetsDir: "", |
| | | chainWebpack: (config) => { |
| | | config.plugin("html").tap((args) => { |
| | | args[0].title = TITLE; |
| | | return args; |
| | | }); |
| | | }, |
| | | css: { |
| | | loaderOptions: { |
| | | scss: { |
| | | additionalData: `@import "${scss_path}";` |
| | | additionalData: `@import "${scss_path}";`, |
| | | }, |
| | | } |
| | | }, |
| | | }, |
| | | devServer: { |
| | | client: { |
| | | overlay: false, |
| | | }, |
| | | port: 8090, |
| | | host: '0.0.0.0', |
| | | host: "0.0.0.0", |
| | | https: false, |
| | | open: true, |
| | | proxy: { |
| | | // 可为不同的接口配置不同的代理地址 |
| | | '/wap/api': { |
| | | "/wap/api": { |
| | | // 服务地址,即你要访问的服务器地址 |
| | | target: 'https://bingx.zqbom.com/', |
| | | target: "https://bingx.zqbom.com/", |
| | | // 路径重写,将'/user/login'重写为'/login' |
| | | pathRewrite: { |
| | | '^/wap/api': '' |
| | | "^/wap/api": "", |
| | | }, |
| | | // 所有信息都在命令行工具打印 |
| | | logLevel: 'debug' |
| | | logLevel: "debug", |
| | | }, |
| | | "/wap/api": { |
| | | // 服务地址,即你要访问的服务器地址 |
| | | target: "http://103.215.76.36:18080/", |
| | | // 路径重写,将'/user/login'重写为'/login' |
| | | pathRewrite: { |
| | | "^/wap/api": "", |
| | | }, |
| | | // 所有信息都在命令行工具打印 |
| | | logLevel: "debug", |
| | | }, |
| | | }, |
| | | } |
| | | }) |
| | | }, |
| | | }); |