Should `src` directory be in `resolve.modules`?
See original GitHub issueThis is a suggestion to remove src
directory from resolve.modules
in webpack.base.conf.js
. I know the convenience of this configuration but users may confuse if they create some new directories in src
and some of them conflict with npm packages’ name.
For instance, there is a case that a user create vuex
directory in src
. So import Vuex from 'vuex'
does not work at all. https://github.com/vuejs/vuex/issues/625
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Support src directory as webpack resolve.modules #3596
Much code that is pasted into Create React App assumes that the src directory is resolved so that filename and module references becomes...
Read more >Resolve | webpack
When enabled, webpack would prefer to resolve module requests as relative requests instead of using modules from node_modules directories. webpack.config.js
Read more >Resolving require paths with webpack - Stack Overflow
This setting should be used to add individual directories to the search path. ... [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules')] ...
Read more >Documentation - Module Resolution - TypeScript
Module resolution is the process the compiler uses to figure out what an import refers to. Consider an import statement like import {...
Read more >Configuring Jest
The directory where Jest should output its coverage files. coveragePathIgnorePatterns [array<string>]. Default: ["/node_modules/"]. An array of ...
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 Free
Top 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
Created a PR #516
I think we already have an alias for
src
. That could also be a problem when someone uses a package namedsrc
(didn’t check but I assume one exists 😄).