Not following webpack aliases
See original GitHub issueWhen using webpack aliases, docz won’t follow them, giving the following error:
ERROR Failed to compile with 3 errors
These dependencies were not found:
* _atoms/overlay in [...]molecules/fields/clockField.js
* _molecules/fields/textField in [...]/molecules/fields/clockField.js
* _molecules/popup in [...]/molecules/fields/clockField.js
To install them, you can run: npm install --save _atoms/overlay _molecules/fields/textField _molecules/popup
My webpack config:
[...]
resolve: {
modules: ['node_modules', 'src/common',],
alias: {
_usvc: path.resolve(__dirname, 'src/usvc'),
_templates: path.resolve(__dirname, 'src/common/templates'),
_organisms: path.resolve(__dirname, 'src/common/organisms'),
_molecules: path.resolve(__dirname, 'src/common/molecules'),
_atoms: path.resolve(__dirname, 'src/common/atoms'),
_app: path.resolve(__dirname, 'src/appComponents'),
_: path.resolve(__dirname, 'src'),
},
},
[...]
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Webpack doesn't resolve properly my alias
I am trying to have a namespace for my app to work as a module, and import my components using this namespace and...
Read more >Not following webpack aliases · Issue #243 · doczjs/docz
When using webpack aliases, docz won't follow them, giving the following error: ERROR Failed to compile with 3 errors These dependencies ...
Read more >Webpack Aliases Keep My Code Sane
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 >Resolve
resolve.alias. object. Create aliases to import or require certain modules more easily. For example, to alias a bunch of commonly used src/ folders:....
Read more >Webpack aliases not resolved when using ... - YouTrack
I have the following config inside a Webpack config file called "webpack.config.dev.js" which lives inside a "config" folder: alias: { 'app': ...
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 @GradyTruitt
To be able to use absolute imports from
./src
you’ll need to modify the docz webpack config to tell it how to resolve paths like"icons/Icons"
.To do that, add a
gatsby-node.js
file in your root directory :You can also see a complete working example here : https://github.com/doczjs/docz/tree/master/examples/webpack-alias
@gmarconi I have a suggestion:
First you can create a file with function called
setAlias
example:In webpack, you will set alias with function
In doczrc, the same thing that above