add support for webpack alias
See original GitHub issueCannot detect the imported file if a project not use relative path import.
For example, use babel-plugin-module-resolver
:
// .babelrc
{
"plugins": [
[ "module-resolver", {
"alias": {
"@": "./src"
}
}]
]
}
or use webpack resolve. alias
module.exports = {
//...
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
}
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Resolve | webpack
you can use the alias: import Utility from 'Utilities/utility';. A trailing $ can also be added to the given object's keys to signify...
Read more >How to Create a Path Alias in Webpack - Bitovi
Establish the Module Aliases · Open your Webpack.config.js file. · If it's not already there, add a resolve property to the configuration object ......
Read more >Simplify your imports with webpack aliases
By adding some options to webpack's resolve configuration object, we can define aliases for specific directories. For example:.
Read more >Webpack Aliases Keep My Code Sane | by Michael McShinsky
Aliases are a way to let webpack know where to find our code by providing a word or character that represents a partial...
Read more >Configuring aliases in webpack + VS Code + Typescript + Jest
Webpack needs to know physical paths that map to the aliases we want to create. In order to inform that mapping, we need...
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
Hey @smeijer, thanks for your reply!
What I mean is to allow resolutions to be set on a per-entry basis. So in your example, maybe
entry[0]
would need to resolveour-utils-platform
toour-utils-node
and inentry[1]
would need to resolveour-utils-platform
toour-utils-web
.It seems like
unimported
makes a configuration like that of its own behind the scenes that looks like below, and it would be great if we could set the same type of config from the.unimportedrc.json
Does that explanation make sense? Thanks again for your hard work and for your reply!
Hi @Slapbox , it is possible to specify
entryFiles
via the config file. Does that help?