const CracoLessPlugin = require('craco-less')
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')

module.exports = {
    devServer: {
        open: true,
        port: 6591,
        proxy: {
            '/api': {
                target: 'http://localhost:5566',
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    },
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                lessLoaderOptions: {
                    lessOptions: {
                        javascriptEnabled: true,
                    },
                },
                importLoaders: 2
            },
        },
    ],
    webpack: {
        plugins: [
            new MonacoWebpackPlugin()
        ]
    },
}