laravel mix sass不会改变

时间:2018-09-22 10:31:24

标签: php laravel webpack sass laravel-mix

我正在尝试使用Laravel Mix来为我的Laravel 5.5应用程序编译我的SASS / JS,但是当我编辑app.scss并运行npm run dev时,更改不会反映出来,并且仍然设置了我的身体颜色到#212121而不是

// Body
$body-bg:                   #2296f3;
$body-color:                #2296f3;

这是我的app.scss当前的样子:

app.scss

这是我的webpack配置的样子:

let mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .sass('resources/assets/sass/custom.scss', 'public/css/custom.css');

感谢您的帮助,我不确定为什么我的Sass无法编译。编译时没有错误...

> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

95% emitting

DONE  Compiled successfully in 3524ms                                                                                                                                                              12:06:10

                                                                                                    Asset     Size  Chunks                    Chunk Names
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.eot?f4769f9bdb7466be65088239c12046d1  20.1 kB          [emitted]
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff2?448c34a56d699c29117adc64c43affeb    18 kB          [emitted]
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.woff?fa2772327f55d8198301fdb8bcfc8158  23.4 kB          [emitted]
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.ttf?e18bbf611f2a2e43afc071aa2f4e1512  45.4 kB          [emitted]
fonts/vendor/bootstrap-sass/bootstrap/glyphicons-halflings-regular.svg?89889688147bd7575d6327160d64e760   109 kB          [emitted]

/js/app.js  1.24 MB       0  [emitted]  [big]  /js/app

/css/app.css   154 kB       0  [emitted]         /js/app

/css/custom.css  0 bytes       0  [emitted]         /js/app

谢谢!

1 个答案:

答案 0 :(得分:0)

根据文档,您可能应该运行

npm run watch-poll