Answer the question
In order to leave comments, you need to log in
How to properly configure modulesDirectories in webpack?
File structure
app/
components/
...
Button/
Button.jsx
webpack.config.js
var Button = require('../Button/Button.jsx);
var Button = require('Button/Button.jsx);
resolve: {
modulesDirectories: ['web_modules', 'node_modules', 'components']
}
resolve: {
modulesDirectories: ['web_modules', 'node_modules', './app/components']
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question