/*******覆盖create-react-app默认配置******/

const path = require('path');
const resolve = dir => path.resolve(__dirname,dir);
const CracoLessPlugin = require('craco-less');
module.exports = {
    /*devServer:{
        port: 8080,
        proxy: {
            '/api': {
                target: 'http://192.168.2.232:8871/',
                changeOrigin: true,
                secure: false,
                xfwd: false,
            }
        }
    },*/
    devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => {
        devServerConfig.proxy={
            '/security-center':'http://192.168.2.237:8871',
		    '/daqe-center':'http://192.168.2.237:8871',
            pathRewrite: {'/center' : ''},
            changeOrigin: true
        };
        return devServerConfig;
    },
    webpack:{
        alias:{
            '@':resolve('src'),
            '@common':resolve('src/common'),
            '@components':resolve('src/components'),
            '@utils':resolve('src/utils'),
            '@images':resolve('src/images'),
            '@store':resolve('src/store'),
            '@actions':resolve('src/store/actions'),
            '@reducers':resolve('src/store/reducers'),
            '@api':resolve('src/api'),
            /*'parchment': resolve('node_modules/parchment/src/parchment.ts'),
            'quill': resolve('node_modules/quill/quill.js'),*/
        }
    },
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                styleLoaderOptions:{},
                cssLoaderOptions:{},
                lessLoaderOptions: {
                    lessOptions: {
                        modifyVars: {
                            '@primary-color': '#1690FF',
                            '@theme-bg-color':'#fff',
                            '@link-color': '#1690FF', // 链接色
                            '@success-color': '#52c41a', // 成功色
                            '@warning-color': '#FE9748', // 警告色
                            '@error-color': '#FF4D4D', // 错误色
                            '@font-size-base': '14px', // 主字号
                            '@heading-color': '#333', // 标题色
                            '@text-color': '#333', // 主文本色
                            '@text-color-secondary': '#666', // 次文本色
                            '@disabled-color': '#999', // 失效色
                            '@border-radius-base': '2px', // 组件/浮层圆角
                            '@border-color-base': '#DEE2E9', // 边框色
                            '@box-shadow-base':'0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),0 9px 28px 8px rgba(0, 0, 0, 0.05)',
                        },
                        javascriptEnabled: true,
                    },
                },
            },
        },
    ],
};