【问题标题】:How can I configure webpack 2.2.0 rc3 (rc4) and bootstrap alpha 6 via bootstrap-loader如何通过 bootstrap-loader 配置 webpack 2.2.0 rc3 (rc4) 和 bootstrap alpha 6
【发布时间】:2017-05-26 17:46:47
【问题描述】:

如何使用 bootstap 4 显示正确的 webpack 2 rc3 配置?

这是我的.bootstraprc

这是我的webpack.config.js

毕竟我在 npm start 上得到了这个错误:

错误 ./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/resolve-url-loader!./ ~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"extractStyles":true,"styleLoaders":["style-loader", "css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","re​​boot","type","images","code ","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar ","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","re​​sponsive-embed","close","badge", "modal","tooltip","popover","carousel","utilities"],"scripts":false,"configFilePath":"/Users/ivan/Dev/react/.bootstraprc","bootstrapPath":" /Users/ivan/Dev/react/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js 模块构建失败:ModuleBuildError:模块构建失败:TypeError: 无法读取未定义 @ 的属性“路径” ./~/bootstrap-loader/lib/bootstrap.loader.js?extractStyles!./~/bootstrap-loader/no-op.js 1:21-1040 @ ./~/bootstrap-loader/extractStyles.js @ 多应用

错误 ./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/resolve-url-loader!./ ~/sass-loader?sourceMap!./~/bootstrap-loader/lib/bootstrap.styles.loader.js?{"bootstrapVersion":4,"extractStyles":true,"styleLoaders":["style-loader", "css-loader","postcss-loader","sass-loader"],"styles":["mixins","normalize","print","re​​boot","type","images","code ","grid","tables","forms","buttons","transitions","dropdown","button-group","input-group","custom-forms","nav","navbar ","card","breadcrumb","pagination","jumbotron","alert","progress","media","list-group","re​​sponsive-embed","close","badge", "modal","tooltip","popover","carousel","utilities"],"scripts":false,"configFilePath":"/Users/ivan/Dev/react/.bootstraprc","bootstrapPath":" /Users/ivan/Dev/react/~/bootstrap","bootstrapRelPath":"../bootstrap"}!./~/bootstrap-loader/no-op.js 模块构建失败:ModuleBuildError:模块构建失败:TypeError: 无法读取对象未定义的属性“路径”。 (/Users/ivan/Dev/react/node_modules/async/dist/async.js:2234:31)

【问题讨论】:

    标签: webpack bootstrap-4 extract-text-plugin


    【解决方案1】:

    我已经解决了我的问题。 问题出在 webpack.config.js

    过得怎么样:

    new webpack.LoaderOptionsPlugin({
    ...
      options: {
        ...
        context: path.resolve(__dirname, '.'),
        ...
      },
    ...
    })
    

    应该怎样

    new webpack.LoaderOptionsPlugin({
    ...
      options: {
        ...
        context: path.resolve(__dirname, '.'),
        output: {
          path: 'dist',
        },
        ...
      },
    ...
    })
    

    【讨论】:

      猜你喜欢
      • 2016-05-20
      • 2018-06-12
      • 2019-11-02
      • 2016-06-03
      • 2017-06-11
      • 2017-04-10
      • 1970-01-01
      • 2020-03-18
      • 1970-01-01
      相关资源
      最近更新 更多