Path aliases for imports in RubyMine from Webpack

For the longest time, I just put up with RubyMine not finding imports that used webpack’s [resolve.modules]( or [resolve.alias]( rather than relative paths.

RubyMine doesn’t like the files with the squiggly lines

rails/webapcker set the source_path directory

In case you’re using rails/webpacker, The modules are setup here:

const getModulePaths = () => {
  const result = new ConfigList()
  result.append('source', resolve(config.source_path))

Fix: Set the “Resource Root” on the “App” Directory



VS Code?

Another way is to let VSCode know how to resolve these aliases by adding a jsconfig.json file to your project at the root.

  "compilerOptions": {
    "paths": {
      "config/*": ["src/config/*"],
      "store/*": ["src/store/*"],
      "utils/*": ["src/utils/*"]
  "exclude": ["node_modules"]