我正面临着bootstrap模块的web-pack编译问题。我是Angular开发的新手。当我运行 ng serve 命令时,我面临以下问题。
当我从styles数组中的angular-cli.json中删除bootstrap css时,它就像魅力一样。
ERROR in multi ./src/node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css
Module not found: Error: Can't resolve 'C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css' in 'C:\Angular Code\First App\my-first-app\node_modules\@angular\cli\models\webpack-configs'
resolve 'C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css' in 'C:\Angular Code\First App\my-first-app\node_modules\@angular\cli\models\webpack-configs'
using description file: C:\Angular Code\First App\my-first-app\node_modules\@angular\cli\package.json (relative path: ./models/webpack-configs)
Field 'browser' doesn't contain a valid alias configuration
after using description file: C:\Angular Code\First App\my-first-app\node_modules\@angular\cli\package.json (relative path: ./models/webpack-configs)
using description file: C:\Angular Code\First App\my-first-app\package.json (relative path: ./src/node_modules/bootstrap/dist/css/bootstrap.min.css)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css.js doesn't exist
as directory
C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css doesn't exist
[C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css]
[C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css.ts]
[C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css.js]
[C:\Angular Code\First App\my-first-app\src\node_modules\bootstrap\dist\css\bootstrap.min.css]
@ multi ./src/node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css