1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- const path = require("path");
- function resolve(dir) {
- return path.join(__dirname, dir);
- }
- // 增加环境变量
- process.env.VUE_APP_VERSION = require("./package.json").version;
- process.env.VUE_APP_BUILD_TIME = require("dayjs")().format("YYYY-M-D HH:mm:ss");
- module.exports = {
- productionSourceMap: false, // 生产环境是否要生成 sourceMap
- publicPath: process.env.NODE_ENV === 'production' ? './smartscreen/' : '', //部署应用包时的基本 URL
- indexPath:'../../public/smartscreen.html',
- outputDir: "../../public/smartscreen/", // 打包时输出的文件目录
- lintOnSave: false, //是否在开发环境下每次保存代码时都启用 eslint验证
- css: {
- loaderOptions: {
- // 设置 scss 公用变量文件
- less: {
- prependData: "@import '~@/lib/public.less';",
- },
- },
- requireModuleExtension: true,
- }, // css的处理
- chainWebpack: (config) => {
- config.resolve.alias
- .set("@", resolve("src"))
- .set("assets", resolve("src/assets"))
- .set("utils", resolve("src/utils"));
- }, //vue-cli内部的webpack配置
- pluginOptions: {}, // 可以用来传递任何第三方插件选项
- devServer: {
- proxy: {
- "/client": {
- target: "https://wzh.nczyzs.com/client", //设置你调用的接口域名和端口号 别忘了加http、https
- changeOrigin: true, //是否跨域
- // secure: true, // 允许https请求
- ws: true,
- pathRewrite: {
- "^/client": "", //这里理解成用‘/api’代替target里面的地址
- },
- },
- "/dashboard": {
- target: "https://wzh.nczyzs.com/dashboard", //设置你调用的接口域名和端口号 别忘了加http、https
- changeOrigin: true, //是否跨域
- // secure: true, // 允许https请求
- ws: true,
- pathRewrite: {
- "^/dashboard": "", //这里理解成用‘/api’代替target里面的地址
- },
- },
- "/index": {
- target: "https://wzh.nczyzs.com/index", //设置你调用的接口域名和端口号 别忘了加http、https
- changeOrigin: true, //是否跨域
- // secure: true, // 允许https请求
- ws: true,
- pathRewrite: {
- "^/index": "", //这里理解成用‘/api’代替target里面的地址
- },
- },
- },
- },
- };
|