We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
components ├── shared │ ├── ErrorMessage.vue │ ├── Loading.vue │ ├── Pagination.vue
こんなコンポーネント郡があり、components/shared/Loading.vue で components/shared/ErrorMessage.vue を読み込む場合に、@や~を使って絶対パス風に書くことがあります。
components/shared/Loading.vue
components/shared/ErrorMessage.vue
@
~
import ErrorMessage from '@/components/shared/ErrorMessage.vue'
この場合に、webpackのモジュールパスの設定をRubyMineにも設定しておくと、Go to Declaration や Go to Implementation でコンポーネント間の移動がしやすくなり、、Auto Completesでコード補完も効くようになります。
Go to Declaration
Go to Implementation
Auto Completes
プロジェクトにwebpackの設定ファイルがあればそれを流用できるのですが、 nextjs や Nuxt.js、 GatsbyJS はフレームワーク内部にwebpackの設定ファイルが隠蔽されてしまっているので、パス解決用にダミーのファイルを作成します。
nextjs
Nuxt.js
GatsbyJS
$ vi .idea/webpack.js
下記設定をコピー。(sourcePathは適宜変更してください。)
sourcePath
const path = require('path'); const sourcePath = path.resolve(path.join(__dirname, '..')) module.exports = { resolve: { extensions: ['.js', '.json', '.vue', '.ts'], root: sourcePath, alias: { '@': sourcePath, '~': sourcePath } } }
Languages & Frameworks > Javascript > Webpackにファイルのパスを入れる。
Languages & Frameworks > Javascript > Webpack
The text was updated successfully, but these errors were encountered:
No branches or pull requests
date: 2019-02-18
title: RubyMineでwebpackのモジュールパスを解決する
summary: ~や@から指定するモジュールのパスをRubyMineで解決する方法を説明します。
slug: resolve-webpack-module-path-for-rubymine
lang: ja-JP
ユースケース
こんなコンポーネント郡があり、
components/shared/Loading.vue
でcomponents/shared/ErrorMessage.vue
を読み込む場合に、@
や~
を使って絶対パス風に書くことがあります。この場合に、webpackのモジュールパスの設定をRubyMineにも設定しておくと、
Go to Declaration
やGo to Implementation
でコンポーネント間の移動がしやすくなり、、Auto Completes
でコード補完も効くようになります。ダミーのwebpack.jsを作成する
プロジェクトにwebpackの設定ファイルがあればそれを流用できるのですが、
nextjs
やNuxt.js
、GatsbyJS
はフレームワーク内部にwebpackの設定ファイルが隠蔽されてしまっているので、パス解決用にダミーのファイルを作成します。下記設定をコピー。(
sourcePath
は適宜変更してください。)RubyMineの設定に該当ファイルを設定する
Languages & Frameworks > Javascript > Webpack
にファイルのパスを入れる。The text was updated successfully, but these errors were encountered: