Mein Webpack-Dev-Server funktioniert ohne Probleme mit meinen bestehenden Abhängigkeiten.Wie wird bugsense.js über das Webpack geladen?
Jetzt möchte ich bugsense
in meinem Projekt verwenden. Die bugsense
-Bibliothek befindet sich nicht im npm-Repository. Diese
ist, wie ich es in meinem package.json umfassen
"dependencies": {
"bootstrap": "^3.3.6",
"bugsense": "bugsense/bugsense.js",
...
Das Paket von Github heruntergeladen wurde, wie erwartet.
aber als ich versuchte, es in einem es6 js Skript zu importieren, wie so
import bugsense from 'bugsense';
bekam ich diese Fehlermeldung
Module not found: Error: Cannot resolve module 'bugsense' in /Users/antkong/dev/projects/web/app/scripts/actions
resolve module bugsense in /Users/antkong/dev/projects/web/app/scripts/actions
looking for modules in /Users/antkong/dev/projects/webview/node_modules
/Users/antkong/dev/projects/webview/node_modules/bugsense doesn't exist (module as directory)
resolve 'file' bugsense in /Users/antkong/dev/projects/webview/node_modules
resolve file
/Users/antkong/dev/projects/webview/node_modules/bugsense doesn't exist
/Users/antkong/dev/projects/webview/node_modules/bugsense.webpack.js doesn't exist
/Users/antkong/dev/projects/webview/node_modules/bugsense.web.js doesn't exist
/Users/antkong/dev/projects/webview/node_modules/bugsense.js doesn't exist
/Users/antkong/dev/projects/webview/node_modules/bugsense.json doesn't exist
looking for modules in /Users/antkong/dev/projects/web/node_modules
resolve 'file' bugsense in /Users/antkong/dev/projects/web/node_modules
resolve file
/Users/antkong/dev/projects/web/node_modules/bugsense is not a file
/Users/antkong/dev/projects/web/node_modules/bugsense.webpack.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense.web.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense.json doesn't exist
resolve 'file' or 'directory' /Users/antkong/dev/projects/web/node_modules/bugsense
resolve file
/Users/antkong/dev/projects/web/node_modules/bugsense is not a file
/Users/antkong/dev/projects/web/node_modules/bugsense.webpack.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense.web.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense.json doesn't exist
resolve directory
directory default file index
resolve file index in /Users/antkong/dev/projects/web/node_modules/bugsense
/Users/antkong/dev/projects/web/node_modules/bugsense/index doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/index.webpack.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/index.web.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/index.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/index.json doesn't exist
use ./lib/node/index.js from package.json
resolve 'file' or 'directory' ./lib/node/index.js in /Users/antkong/dev/projects/web/node_modules/bugsense
resolve file
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.webpack.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.web.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.js doesn't exist
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.json doesn't exist
resolve directory
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js doesn't exist (directory default file)
/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js/package.json doesn't exist (directory description file)
[/Users/antkong/dev/projects/web/node_modules/bugsense.webpack.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense.webpack.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense.web.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense.web.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense.json]
[/Users/antkong/dev/projects/web/node_modules/bugsense.json]
[/Users/antkong/dev/projects/webview/node_modules/bugsense]
[/Users/antkong/dev/projects/webview/node_modules/bugsense]
[/Users/antkong/dev/projects/webview/node_modules/bugsense.webpack.js]
[/Users/antkong/dev/projects/webview/node_modules/bugsense.web.js]
[/Users/antkong/dev/projects/webview/node_modules/bugsense.js]
[/Users/antkong/dev/projects/webview/node_modules/bugsense.json]
[/Users/antkong/dev/projects/web/node_modules/bugsense/index]
[/Users/antkong/dev/projects/web/node_modules/bugsense/index.webpack.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/index.web.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/index.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/index.json]
[/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.webpack.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.web.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.js]
[/Users/antkong/dev/projects/web/node_modules/bugsense/lib/node/index.js.json]
@ ./app/scripts/actions/someActions.js 21:16-35
Webpack versagt das Modul aufgrund einer fehlenden Datei zu laden.
Wie kann ich es beheben? Kann ich es einfach über eine Webpack-Konfiguration reparieren?