不兼容的单位:’rem’和’px’ – Bootstrap 4和Laravel Mix

前端之家收集整理的这篇文章主要介绍了不兼容的单位:’rem’和’px’ – Bootstrap 4和Laravel Mix前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我刚安装了一个新的Laravel 5.4和bootstrap 4 alpha 6. Laravel mix不会编译SASS:
这是一个错误
Module build Failed: ModuleBuildError: Module build Failed: 
$input-height:                   (($font-size-base * $input-line-height) + ($input-padding-y * 2)) !default;
                                ^
      Incompatible units: 'rem' and 'px'.
      in /Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/bootstrap/scss/_variables.scss (line 444,column 34)
    at runLoaders (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/webpack/lib/NormalModule.js:192:19)
    at /Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/loader-runner/lib/LoaderRunner.js:364:11
    at /Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/loader-runner/lib/LoaderRunner.js:230:18
    at context.callback (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at Object.asyncSassJobQueue.push [as callback] (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/lib/loader.js:57:13)
    at Object.<anonymous> (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:2262:31)
    at apply (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:20:25)
    at Object.<anonymous> (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:56:12)
    at Object.callback (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/sass-loader/node_modules/async/dist/async.js:944:16)
    at options.error (/Volumes/HDD/nicolae/Dev/htdocs/test/node_modules/node-sass/lib/index.js:294:32)

 @ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss

有人通过了吗?如何?

解决方法

解决

>从package.json中删除bootstrap条目并将其替换为
“bootstrap”:“4.0.0-alpha.6”,位于resources / assets / sass / app.scss中,
>注释掉变量的导入.将bootstrap的路径更改为
@import“node_modules / bootstrap / scss / bootstrap.scss”;
>在resources / assets / js / bootstrap.js中,查找require(‘bootsrap-sass’);
并将其更改为require(‘bootstrap’);

Link!

原文链接:https://www.f2er.com/css/217999.html

猜你在找的CSS相关文章