您好,我對新的 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但這在運行時從未改變......
5 回答

慕田峪9158850
TA貢獻1794條經驗 獲得超8個贊
我嘗試了以下步驟來清理公用文件夾,它解決了我的問題。
從公用文件夾中刪除以下文件:
mix-manifest.json
js文件夾內的所有文件
任何以數字命名的文件,例如:123.js
然后運行以下命令:
npm 運行開發
npm 運行手表
- 5 回答
- 0 關注
- 180 瀏覽
添加回答
舉報
0/150
提交
取消