我遵循了基于NPM的AngularJS与Laravel 5中提供的一个答案,但我无法使用Gulp成功地编译lumx的SCSS文件。
有人知道怎么解决吗?
我的app.scss包含以下内容:
@import "../../../bower_components/mdi/scss/materialdesignicons";
@import "../../../bower_components/lumx/dist/scss/lumx";在喝了一口之后,我得到了这个错误:
gulp-notify: [Laravel Elixir] Sass Compilation Failed: bower_components\lumx\dist\scss\_lumx.scss
Error: File to import not found or unreadable: bourbon
Parent style sheet: D:/laragon1.0.6/www/task-manager/bower_components/lumx/dist/scss/_lumx.scss
on line 5 of bower_components/lumx/dist/scss/_lumx.scss
>> @import "bourbon";_lumx.scss文件
@import "bourbon";
@import "materialdesignicons";
@import "settings/colors";
@import "settings/defaults";
@import "settings/responsive";我的bower_components文件夹在我的Laravel应用程序的根文件夹中。所有javascript文件都适用于Elixir任务,但只有scss文件有问题。
发布于 2017-01-11 18:56:48
我能把朗姆士和拉拉结合起来。
进入项目文件夹
npm安装 鲍尔 bower安装lumx --保存
elixir((mix) => {
//mix.sass('app.scss');
//mix.webpack('app.js');
mix.styles('./bower_components/lumx/dist/lumx.css');
mix.styles('./bower_components/mdi/css/materialdesignicons.css');
mix.scripts('./bower_components/jquery/dist/jquery.js');
mix.scripts('./bower_components/velocity/velocity.js');
mix.scripts('./bower_components/moment/min/moment-with-locales.js');
mix.scripts('./bower_components/angular/angular.js');
mix.scripts('./bower_components/lumx/dist/lumx.js');
mix.copy('./bower_components/mdi/fonts', 'public/fonts');
});
<!DOCTYPE html>
<html lang="en" ng-app = "myModule">
<head>
<meta charset="UTF-8">
<title>Laravel Lumx</title>
<link rel="stylesheet" href="{{ asset('css/lumx.css') }}">
<link rel="stylesheet" href="{{ asset('css/materialdesignicons.css') }}">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
</head>
<body>
<div class="p+">
Hello
</div>
<div class="p+">
<lx-button lx-type="raised">Button</lx-button>
<lx-button lx-type="flat">Button</lx-button>
<lx-button lx-type="fab"><i class="mdi mdi-plus"></i></lx-button>
<lx-button lx-type="icon"><i class="mdi mdi-plus"></i></lx-button>
</div>
<div class="p+">
<lx-switch ng-model="vm.switches.colors.blue" lx-color="blue">Blue switch</lx-switch>
<lx-switch ng-model="vm.switches.colors.green" lx-color="green" class="mt+">Green switch</lx-switch>
<lx-switch ng-model="vm.switches.colors.orange" lx-color="orange" class="mt+">Orange switch</lx-switch>
<lx-switch ng-model="vm.switches.colors.red" lx-color="red" class="mt+">Red switch</lx-switch>
</div>
<script src="{{ asset('js/jquery.js') }}"></script>
<script src="{{ asset('js/velocity.js') }}"></script>
<script src="{{ asset('js/moment-with-locales.js') }}"></script>
<script src="{{ asset('js/angular.js') }}"></script>
<script src="{{ asset('js/lumx.js') }}"></script>
<script>
angular.module('myModule', ['lumx']);
</script>
</body>
</html>
Route::get('/', function () {
return view('test');
});
配置gulpfile.js
elixir((mix) => {
//mix.sass('app.scss');
//mix.webpack('app.js');
mix.styles([
'./bower_components/lumx/dist/lumx.css',
'./bower_components/mdi/css/materialdesignicons.css'
], 'public/css/lumxall.css');
mix.scripts([
'./bower_components/jquery/dist/jquery.js',
'./bower_components/velocity/velocity.js',
'./bower_components/moment/min/moment-with-locales.js',
'./bower_components/angular/angular.js',
'./bower_components/lumx/dist/lumx.js'
], 'public/js/lumxall.js');
mix.copy('./bower_components/mdi/fonts', 'public/fonts');
});
<!DOCTYPE html>
<html lang="en" ng-app = "myModule">
<head>
<meta charset="UTF-8">
<title>Laravel Lumx</title>
<link rel="stylesheet" href="{{ asset('css/lumxall.css') }}">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
</head>
<body>
<div class="p+">
Hola
</div>
<div class="p+">
<lx-button lx-type="raised">Button</lx-button>
<lx-button lx-type="flat">Button</lx-button>
<lx-button lx-type="fab"><i class="mdi mdi-plus"></i></lx-button>
<lx-button lx-type="icon"><i class="mdi mdi-plus"></i></lx-button>
</div>
<div class="p+">
<lx-switch ng-model="vm.switches.colors.blue" lx-color="blue">Blue switch</lx-switch>
<lx-switch ng-model="vm.switches.colors.green" lx-color="green" class="mt+">Green switch</lx-switch>
<lx-switch ng-model="vm.switches.colors.orange" lx-color="orange" class="mt+">Orange switch</lx-switch>
<lx-switch ng-model="vm.switches.colors.red" lx-color="red" class="mt+">Red switch</lx-switch>
</div>
<script src="{{ asset('js/lumxall.js') }}"></script>
<script>
angular.module('myModule', ['lumx']);
</script>
</body>
</html>
https://stackoverflow.com/questions/35915446
复制相似问题