Skip to content

Commit 8f516be

Browse files
astandrikAnton Standrik
andauthored
fix: autocomplete not working in standalone version (#1405)
Co-authored-by: Anton Standrik <[email protected]>
1 parent 8ef7604 commit 8f516be

File tree

3 files changed

+1317
-927
lines changed

3 files changed

+1317
-927
lines changed

config-overrides.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
44
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
55
const srcRoot = path.resolve(__dirname, 'src');
66
const uiKitRoot = path.resolve(__dirname, 'node_modules/@gravity-ui/uikit');
7+
const antlr4C3Root = path.resolve(__dirname, 'node_modules/antlr4-c3');
8+
const websqlRoot = path.resolve(__dirname, 'node_modules/@gravity-ui/websql-autocomplete');
9+
const antlr4ngRoot = path.resolve(__dirname, 'node_modules/antlr4ng');
710
const uiKitIconsRoot = path.resolve(__dirname, 'node_modules/@gravity-ui/icons');
811

912
module.exports = {
1013
webpack: (config, env) => {
1114
const oneOfRule = config.module.rules.find((r) => r.oneOf);
15+
1216
oneOfRule.oneOf.splice(0, 0, {
1317
test: /\.svg$/,
1418
include: [
@@ -20,6 +24,13 @@ module.exports = {
2024
options: {dimensions: false},
2125
});
2226

27+
oneOfRule.oneOf.splice(1, 0, {
28+
test: [/\.[jt]sx?$/, /\.[cm]js$/],
29+
include: [antlr4C3Root, websqlRoot, antlr4ngRoot],
30+
loader: 'babel-loader',
31+
options: {babelrc: false, configFile: false, compact: true},
32+
});
33+
2334
if (env === 'production') {
2435
config.output.path = path.resolve(__dirname, 'build/');
2536
}

0 commit comments

Comments
 (0)