Skip to content

Commit

Permalink
fix: autocomplete not working in standalone version (#1405)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Standrik <[email protected]>
  • Loading branch information
astandrik and Anton Standrik authored Oct 4, 2024
1 parent 8ef7604 commit 8f516be
Show file tree
Hide file tree
Showing 3 changed files with 1,317 additions and 927 deletions.
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 MiniCSSExtractPlugin = require('mini-css-extract-plugin');
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,6 +24,13 @@ module.exports = {
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'
}
Expand Down
Loading

0 comments on commit 8f516be

Please sign in to comment.