您好,我对新的 Laravel 项目有疑问。我知道在命令 npm run watch 之后应该自动编译 scss 和 js 。但它没有识别出任何变化,我不知道为什么。
我的 webpack.mix.js 看起来像这样:
const 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/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
为了编译更改,我必须每次 npm run watch 。如果您知道为什么请告诉我。
Log from console:
DONE Compiled successfully in 8794ms 7:57:59 AM
Asset Size Chunks Chunk Names
/css/app.css 179 KiB /js/app [emitted] /js/app
/js/app.js 1.66 MiB /js/app [emitted] /js/app
但这在运行时从未改变......
FFIVE
白衣染霜花
慕田峪9158850
慕婉清6462132
Smart猫小萌