1

我正在尝试使用 webpack 创建 bootstrap 4 的自定义构建,但它不会编译。

我在这里有引导程序 4:

/node_modules/bootstrap/scss

我创建了自己的 app.scss 文件来导入我想要的引导程序的各个部分:

@import "variables";
@import "mixins";
@import "custom";
....

在我的 webpack 文件中,我有:

mix.sass('resources/assets/sass/app.scss', 'public/css', null, { includePaths: ['node_modules/bootstrap/scss/'] });

我也试过:

mix.sass('resources/assets/sass/app.scss', 'public/css', { includePaths: ['node_modules/bootstrap/scss/'] });
4

1 回答 1

2

您可以使用以下命令在 app.scss 中导入引导程序:

..
@import "~bootstrap/scss/variables"
@import "~bootstrap/scss/mixins"
..

~bootstrap重新添加到 npm 包中。这样您就不必配置混合文件。

于 2017-02-16T13:27:51.797 回答