Why not include 'dist' folder in npm package?
See original GitHub issueWhen i use webpack to compile file, console show these error message.
ERROR in debug (bower component)
Module not found: Error: Cannot resolve 'file' or 'directory' ./dist/debug.js in /Users/stevenjlho/Work/v4s/htdocs/node_modules/debug
@ debug (bower component) 1:17-43
Npm package version is 2.2.0.
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (6 by maintainers)
Top Results From Across the Web
npm install doesnt create dist folder - Stack Overflow
It will create the node_modules directory in your current directory (if one doesn't exist yet), and will download the package to that directory....
Read more >Why not include 'dist' folder in npm package? #242 - GitHub
This is because of this setting: searchResolveModulesDirectories . It is set to true by default and thus searches for the bower components in ......
Read more >What Really Gets Packaged?. Including and excluding files in ...
gitignore file, it is included in the npm package because we explicitly included it in the files field.
Read more >npm-prepare-dist
NPM Prepare Dist CLI. Clean and prepare dist folder and all files before publishing your NPM library. Potentially smaller build and faster ...
Read more >How to make your own npm package with typescript
It just uses tsc is used to compile the files to the dist folder, and the dist folder is published to npm !...
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
There is no need to disable
searchResolveModulesDirectories
. Just addnode_modules
to theexcludes
array.For anyone using
bower-webpack-plugin
: The main issue is that it is recognizing the npm package as a bower component. This is because of this setting:searchResolveModulesDirectories
. It is set to true by default and thus searches for the bower components inresolve.modulesDirectories
. This probably points to yournode_modules
directory which is causing the plugin to see the npm package as a bower component. To resolve, simply set this as false in your webpack config. Hope this helps!