Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const webpack = require('webpack');
const srcRoot = path.resolve(__dirname, 'src');
const uiKitRoot = path.resolve(__dirname, 'node_modules/@gravity-ui/uikit');
const antlr4C3Root = path.resolve(__dirname, 'node_modules/antlr4-c3');
const websqlRoot = path.resolve(__dirname, 'node_modules/@gravity-ui/websql-autocomplete');
const antlr4ngRoot = path.resolve(__dirname, 'node_modules/antlr4ng');
const uiKitIconsRoot = path.resolve(__dirname, 'node_modules/@gravity-ui/icons');

const packageJson = require('./package.json');

module.exports = {
webpack: (config, env) => {
const oneOfRule = config.module.rules.find((r) => r.oneOf);
Expand All @@ -32,7 +35,7 @@
});

if (env === 'production') {
config.output.path = path.resolve(__dirname, 'build/');

Check warning on line 38 in config-overrides.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'
}
config.plugins.push(
new MonacoWebpackPlugin({
Expand All @@ -45,6 +48,13 @@
}),
);

// Add DefinePlugin to expose just the version
config.plugins.push(
new webpack.DefinePlugin({
'process.env.UI_VERSION': JSON.stringify(packageJson.version),
}),
);

const cssExtractPlugin = config.plugins.find((p) => p instanceof MiniCSSExtractPlugin);
if (cssExtractPlugin) {
cssExtractPlugin.options.ignoreOrder = true;
Expand All @@ -58,13 +68,13 @@
// By default jest does not transform anything in node_modules
// So this override excludes node_modules except @gravity-ui
// see https://github.com/timarney/react-app-rewired/issues/241
config.transformIgnorePatterns = ['node_modules/(?!(@gravity-ui|@mjackson)/)'];

Check warning on line 71 in config-overrides.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'

// Add .github directory to roots
config.roots = ['<rootDir>/src', '<rootDir>/.github'];

Check warning on line 74 in config-overrides.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'

// Update testMatch to include .github directory
config.testMatch = [

Check warning on line 77 in config-overrides.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
'<rootDir>/.github/**/*.{spec,test}.{js,jsx,ts,tsx}',
Expand Down
Loading
Loading