twitter-bootstrap - 请帮助指出导致生产模式下 Bootstrap 编译失败的错误/问题
问题描述
在这方面严重需要帮助,拜托!我在使用 bootstrap ^5.1.1 学习 webpack ^5.55.1 时编译 Bootstrap 5 面临严峻挑战(没有反应,vue .. 在这个阶段什么都没有)。开发编译没问题,但在生产模式下构建时失败(附截图)。它不指向任何特定文件,index.sass:1:8744
而只是导入一些 bootstrap.scss 文件。
我在下面提供一切必要的东西。哪位大侠能帮帮我!虽然我不好意思提出这么长的问题,但我们强烈要求任何帮助,我们将不胜感激。
Package.json脚本:
"build-dev": "cross-env NODE_ENV=development webpack --stats-children",
"build": "cross-env NODE_ENV=production webpack"
(我发现还有一个症状:wcript“build”每次都失败,但脚本“build-dev”在我尝试使用 sassOptions{} 缩小输出 CSS 时也失败。我希望这个信息有助于解决它反正。)
Webpack.config.js (sass 规则):
rules: [
{
test: /\.s[ac]ss$/i,
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
},
"postcss-loader",
{
loader: "sass-loader",
options: {
sassOptions: {
includePaths: [
path.join(__dirname, "node_modules"),
path.join(__dirname, "./src/styles/sass"),
],
},
},
},
],
},
...]
和
plugins: [
new MiniCssExtractPlugin({
filename: "css/[name].css",
chunkFilename: "[id].css",
}),
...]
网站.js
import "../styles/index.sass";
import funcParentNavigation from "./bl01-navigation.js";
糟糕的索引.sass
/*! Bootstrap Essentials */
@import node_modules/bootstrap/scss/functions
@import node_modules/bootstrap/scss/variables
@import node_modules/bootstrap/scss/mixins
@import node_modules/bootstrap/scss/utilities
/*! Bootstrap Layout & components */
@import node_modules/bootstrap/scss/root
@import node_modules/bootstrap/scss/reboot
@import node_modules/bootstrap/scss/type
解决方案
推荐阅读
- c# - c# listview列如何设置unsizable?
- javascript - ES6 模块的 module.exports 等价物是什么?
- git - 即使配置了 ssh,为什么“去获取”使用 https?
- javascript - 打破请求-承诺的循环
- html - 显示来自 ASP.NET 的数据时表损坏
- javascript - HTML,Javascript:对具有相同名称的 div 元素中的值求和并将 sum 写入另一个 div 元素
- javascript - 是否可以将 HERE Map 与 firebase firestore 数据库一起使用?
- javascript - 如何使用 Typescript 对具有后备值的解构对象进行类型检查?
- java - 在android中表示时间的最佳方式是什么?
- kotlin - Kotlin - 数据类类型字符串或一些对象