Angular Webpack添加Bootstrap ..[错误]要导入的文件没有找到或不可读:./bootstrap/



对于我的项目,我将使用Bootstrap。

我尝试安装"bootstrap": "^4.0.0-alpha.5"

使用本教程https://github.com/AngularClass/angular2-webpack-starter/wiki/How-to-use-Bootstrap-4-and-Sass-(and-jQuery)

但这对我不起作用。

我看到这个错误:

ERROR in ./~/css-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js
Module build failed:
undefined
^
      File to import not found or unreadable: ../bootstrap/scss/_pager
Parent style sheet: stdin
      in D:ProjetsPROJECTworkspaceproject-frontnode_modulesbootstrap-loaderno-op.js (line 24, column 1)
 @ ./~/style-loader!./~/css-loader!./~/resolve-url-loader!./~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js!./~/bootstrap-loader/no-op.js 4:14-164

你有什么想法或解决方案给我;)?

我也遇到了同样的问题。我通过将.bootstraprc中的几个参数设置为false来解决这个问题。

  pager: false
  labels: false
  utilities-background: false
  utilities-spacing: false
  utilities-responsive: false

最新更新