admin管理员组文章数量:1415654
Hi I have issue with new laravel project. I know it should be autopile scss and js after mand npm run watch. But it not recognized any changes and i don t know why.
My webpack.mix.js looks like this:
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 piling 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');
For piling a changes i have to put every time npm run watch. Please if you know why let me know.
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
But this never changed in runtime....
Hi I have issue with new laravel project. I know it should be autopile scss and js after mand npm run watch. But it not recognized any changes and i don t know why.
My webpack.mix.js looks like this:
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 piling 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');
For piling a changes i have to put every time npm run watch. Please if you know why let me know.
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
But this never changed in runtime....
Share Improve this question edited Jul 14, 2020 at 8:00 Young L. asked Jul 14, 2020 at 7:51 Young L.Young L. 1,0424 gold badges19 silver badges37 bronze badges5 Answers
Reset to default 3first run
npm run dev
then run
npm run watch
Try npm run watch-poll
. Watch mand don't always work. So watch-poll
checks for file changes manually every few milliseconds.
I tried the following steps to clean the public folder and it solved the issue for me.
Delete the following files from the public folder:
- mix-manifest.json
- All files inside the js folder
- Any file named in numeric, ex: 123.js
Then run the following mands:
- npm run dev
- npm run watch
Oh I run npm run watch on homestead server... When i try it in local enviroment it works fine. This is solution
In my case, the npm upgrade
solved the issue.
本文标签: javascriptLaravel npm run watch not compile in runtime scss and jsStack Overflow
版权声明:本文标题:javascript - Laravel npm run watch not compile in runtime scss and js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745148604a2644813.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论