UNPKG

@nx/rspack

Version:

The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.

21 lines (20 loc) 656 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.applyReactConfig = applyReactConfig; function applyReactConfig(options = {}, config = {}) { if (global.NX_GRAPH_CREATION) return; addHotReload(config); // enable rspack node api config.node = { __dirname: true, __filename: true, }; } function addHotReload(config) { const ReactRefreshPlugin = require('@rspack/plugin-react-refresh'); const isDev = process.env.NODE_ENV === 'development' || config.mode === 'development'; if (isDev) { config.plugins.push(new ReactRefreshPlugin({ overlay: false })); } }