在我们的Laravel 5.1应用程序中,我们使用elixir和gulp从sass编译css。当我们只运行gulp
时,一切都正确编译,css文件是最新的。然而,当我们运行gulp watch
并更新.scss文件时,Gulp说Sass编译成功,但css文件没有最新的更改。我们做错了什么?
添加了gulpfile.js内容:
var gulp = require('gulp'); var elixir = require('laravel-elixir'); elixir(function(mix){});mix.copy("vendor/kwizer15/jquery/jquery.js", "resources/assets/js/jquery.js") .copy("vendor/kwizer15/jquery-ui/dist/jquery-ui.js", "resources/assets/js/jquery-ui.js") .copy("vendor/kwizer15/jquery-ui/dist/jquery-ui.css", "resources/assets/css/jquery-ui.css") .copy("vendor/kwizer15/jquery-ui/dist/images/**", "public/images/") .copy("vendor/kwizer15/highcharts/highcharts.js", "resources/assets/js/highcharts.js") .copy("vendor/fortawesome/font-awesome/css/font-awesome.css", "resources/assets/css/font-awesome.css") .copy("vendor/fortawesome/font-awesome/fonts/**", "public/build/fonts/") .copy("vendor/twbs/bootstrap/dist/css/bootstrap.css", "resources/assets/css/bootstrap.css") .copy("vendor/twbs/bootstrap/dist/js/bootstrap.js", "resources/assets/js/bootstrap.js") .copy("vendor/twbs/bootstrap/dist/fonts/**", "public/assets/fonts/") .copy("vendor/rjacobsen/jquery-nestable/src/jquery.nestable.css", "public/css/jquery.nestable.css") .copy("vendor/rjacobsen/jquery-nestable/src/jquery.nestable.js", "public/js/jquery.nestable.js") .copy("bower_components/mjolnic-bootstrap-colorpicker/dist/css/**", "public/css/") .copy("bower_components/mjolnic-bootstrap-colorpicker/dist/img/**", "public/images/") .copy("bower_components/mjolnic-bootstrap-colorpicker/dist/js/**", "public/js/") .scripts( [ 'jquery.js', 'jquery-ui.js', 'bootstrap.js', 'highcharts.js' ] ) .styles( [ 'font-awesome.css', 'bootstrap.css', 'jquery-ui.css', 'custom/nav_styles.css' ] ) .phpUnit() .version(["css/all.css", "js/all.js"]); mix.sass(['reseller_settings.scss'], 'public/css/reseller_settings.css'); mix.sass(['menu_builder.scss'], 'public/css/menu_builder.css'); mix.sass(['nav_menu.scss'], 'public/css/nav_menu.css');
答案 0 :(得分:0)
我遇到了同样的问题。但我将文件移动到与主文件
相同的目录中在: 资源/资产/自定义
在: 资源/资产/ SASS /自定义