diff --git a/web/config-overrides.js b/web/config-overrides.js index f7fef8f53..ebba1aeb2 100644 --- a/web/config-overrides.js +++ b/web/config-overrides.js @@ -1,27 +1,23 @@ /* config-overrides.js */ -const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); - +const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin"); module.exports = function override(config) { - if (!config.plugins) { - config.plugins = []; - } - config.plugins.push( - new MonacoWebpackPlugin() - ); - switch (process.env.NODE_ENV) { - case 'production': - config.plugins = config.plugins.filter(plugin => { - return plugin.constructor.name !== 'ForkTsCheckerWebpackPlugin'; - }); - return config; - default: - let forkTsCheckerWebpackPlugin = config.plugins.find(plugin => { - return plugin.constructor.name === 'ForkTsCheckerWebpackPlugin'; - }); - forkTsCheckerWebpackPlugin.memoryLimit = 4096; - return config; - } + if (!config.plugins) { + config.plugins = []; + } + config.plugins.push(new MonacoWebpackPlugin()); + if (process.env.NODE_ENV === "production") { + config.plugins = config.plugins.filter((plugin) => { + return plugin.constructor.name !== "ForkTsCheckerWebpackPlugin"; + }); + return config; + } + + let forkTsCheckerWebpackPlugin = config.plugins.find((plugin) => { + return plugin.constructor.name === "ForkTsCheckerWebpackPlugin"; + }); + forkTsCheckerWebpackPlugin.memoryLimit = 4096; + return config; }; // Ref https://github.com/microsoft/monaco-editor/issues/82 -// Ref https://www.gitmemory.com/issue/facebook/create-react-app/7135/497102755 \ No newline at end of file +// Ref https://www.gitmemory.com/issue/facebook/create-react-app/7135/497102755