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
11 changes: 11 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
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');

module.exports = {
webpack: (config, env) => {
const oneOfRule = config.module.rules.find((r) => r.oneOf);

oneOfRule.oneOf.splice(0, 0, {
test: /\.svg$/,
include: [
Expand All @@ -20,8 +24,15 @@
options: {dimensions: false},
});

oneOfRule.oneOf.splice(1, 0, {
test: [/\.[jt]sx?$/, /\.[cm]js$/],
include: [antlr4C3Root, websqlRoot, antlr4ngRoot],
loader: 'babel-loader',
options: {babelrc: false, configFile: false, compact: true},
});

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

Check warning on line 35 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 @@ -47,7 +58,7 @@
// 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)/)'];

Check warning on line 61 in config-overrides.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'

return config;
},
Expand Down
Loading
Loading