Closed
Description
Much code that is pasted into Create React App assumes that the src directory is resolved so that filename and module references becomes the same.
people want to write
import 'components/Accordion'
instead of
import './components/Accordion'
because then at some point, components could be a module.
Drawback is that the thing won’t run no more unless using webpack resolver.
The suggestion is to modify webpack.config.js and such to:
resolve: {
modules: [
path.resolve('src'),
path.resolve('module_override'),
'node_modules', ….
(using the paths object, obviously)
from:
resolve: {
// This allows you to set a fallback for where Webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
// if there are any conflicts. This matches Node resolution mechanism.
// https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules', paths.appNodeModules].concat(
Metadata
Metadata
Assignees
Labels
No labels