[idea] Aliases for moduleRoots
See original GitHub issueHi and thx for a good tool!
I like to use webpack aliases in my Vue projects (for example: https://github.com/vuejs-templates/webpack/blob/master/template/build/webpack.base.conf.js#L21-L29),
but when I trying use something like import Module from '@/myComponent/file'
, I get error module @/myComponent/file was not found
.
And Yes, I have moduleRoots
in my package.json. It work perfect for other cases.
May be possible, make some aliases in moduleRoots
? For example:
{
"moduleRoots": [ "src/", {"@": "src/components/"} ]
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Is there a canonical way to set up prefixed @ / ~ aliases?
Situation In projects, we're using a variety of different ways to set up aliases: webpack (simple and complex) typescript (.tsconfig)...
Read more >Module Resolution or Import Alias: The Final Guide - Raul Melo
Tired to have weird imports? It's time to learn how can you enable aliases to your imports and let code more organized.
Read more >Smart JS GoTo - Visual Studio Marketplace
This extension lets you jump to your files, even if they're aliased through webpack, typescript, or other tools.
Read more >Essentials · The Julia Language
Within a module, you can control which names from other modules are visible (via importing), and specify which of your names are intended...
Read more >android/src/com/android/tools/idea/wizard/TemplateWizardState ...
Suffix added by default to activity names */ ... File moduleRoot = new File(projectRoot, (String)get(NewProjectWizardState.ATTR_MODULE_NAME));.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aaronatmycujoo Over a month later, but if you’re still interested, I added support for webpack aliases in my branch: https://github.com/alexanthony/js-hyperclick
If you have a webpack configuration from the webpack template of vue-cli, follow this steps:
Resolve with webpack
build/webpack.base.conf.js
in the field Webpack configuration filenameNo need of moduleRoots entry in package.json.
Great work @alexanthony!