docs.js 1.72 KB
/*
 * @Date: 2021-08-18 12:47:05
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2023-11-23 16:22:12
 * @FilePath: /vue-flow-editor/build/docs.js
 * @Description: 文件描述
 */
const $utils = require('./build.utils')

module.exports = {
    publicPath: './',
    outputDir: 'custom_flow',
    pages: {
        index: {
            entry: $utils.resolve('doc/main.ts'),
            template: 'public/index.html',
            filename: 'index.html',
            title: 'vue-flow-editor',
            chunks: ['chunk-vendors', 'chunk-common', 'index'],
        },
    },
    configureWebpack:{
        module: {
            rules: [
                {
                    test: /\.mjs$/,
                    include: /node_modules/,
                    type: "javascript/auto"
                },
            ]
        }
    },
    devServer: {
        open: true,
        // open: process.platform === 'darwin',
        host: '0.0.0.0',
        port: 4418,
        https: false,
        hotOnly: false,
        compress: true,
        // 设置代理
        proxy: {
            '/admin/': {
            // filter: ['/op/', '/fi/', '/de/', '/st/', '/fr/', '/pr/', '/pu/', '/dl/', '/b/', '/t/', '/rpt/', '/mm/', '/mp/'],
            target: 'https://oa-dev.onwall.cn',
            changeOrigin: true,
            // pathRewrite: {
            //   '^/api': ''
            // },
            onProxyReq: function (proxyReq, req, res, options) {
                proxyReq.setHeader('X-Proxy-Host', req.header('host'));
                proxyReq.setHeader('X-Proxy-Request-URI', req.url);
            }
            }
        },
        before: app => {},
        overlay: {
            warnings: false,
            errors: true
        }
        },
}