const { defineConfig } = require('@vue/cli-service')
const baseUrl = require('./src/utils/baseUrl.js')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = defineConfig({
    transpileDependencies: true,
    lintOnSave: false,
    // baseUrl: BASE_URL,
    // chainWebpack: config => {
    //     config.resolve.alias
    //         .set('@', resolve('src'))
    //         .set('_c', resolve('src/components'))
    //         .set('_conf', resolve('config'))
    // },
    publicPath: '/',
    configureWebpack: {
        externals: {
            'fs': require('fs')
        },
        plugins: [
            new MonacoWebpackPlugin()
          ]
    },
    devServer: {
        port: 8080,
        proxy: process.env.NODE_ENV === "development" ? {
            [baseUrl.ROOT]: {
                target: baseUrl.URL,
                // target: 'http://192.168.2.4:8086',
                changeOrigin: true,
                ws: false,
                pathRewrite: {
                    // '^/api': ''
                    [`^${baseUrl.ROOT}`]: ''
                }
            },
        } : baseUrl.ROOT
    }
})

