Skip to content

Instantly share code, notes, and snippets.

@zmts
Last active June 9, 2023 07:40
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save zmts/bd620cd473e6c96e8884f03d0cee7f15 to your computer and use it in GitHub Desktop.
Save zmts/bd620cd473e6c96e8884f03d0cee7f15 to your computer and use it in GitHub Desktop.
Resolve Webpack alias in Webstorm

Resolve Webpack alias in Webstorm

import UiButton from '@/components/UiButton'
import UiDataBox from '@/components/UiDataBox'

https://blog.jetbrains.com/webstorm/2017/06/webstorm-2017-2-eap-172-2827/

By default WebStorm will analyse the webpack configuration file in the root of the project, but you can select another file in Preferences | Languages & Frameworks | JavaScript | Webpack

For Vue cli v3

project_path/node_modules/@vue/cli-service/webpack.config.js

or

// webpack.config.js

module.exports = {
  resolve: {
    alias: {
      '@': require('path').resolve(__dirname, 'src')
    }
  }
};
@CAT6e
Copy link

CAT6e commented Jun 29, 2020

It works! Thank you ❤️

@imgss
Copy link

imgss commented Jun 9, 2023

thanks ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment