【问题标题】:Failed to resolve 'node_modules/bootstrap/scss/bootstrap'无法解析“node_modules/bootstrap/scss/bootstrap”
【发布时间】:2021-03-08 19:59:28
【问题描述】:

在 Parcel 编译过程中,出现此错误:

@parcel/core: Failed to resolve '../node_modules/bootstrap/scss/bootstrap'

我的app.css 文件:

@import '../node_modules/bootstrap/scss/bootstrap.scss';
@import './styles/style.scss';
@import './styles/plugins/plugins.scss';
@import './styles/plugins/plugins.css';
@import './styles/loader.scss';
@import './styles/custom.css';

为什么 Parcel 无法识别正确的引导 SCSS?

【问题讨论】:

    标签: twitter-bootstrap parcel


    【解决方案1】:

    我无法解释为什么会这样,但是创建一个单独的文件可以解决问题:

    @import './styles/bootstrap.scss';
    

    然后在bootstrap.scss:

    @import 'node_modules/bootstrap/scss/bootstrap.scss';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 2014-03-14
      • 2017-11-26
      相关资源
      最近更新 更多