![](/img/trans.png)
[英]Laravel 4 migrate:make not working; just stops after “Compiling views” step
[英]npm run watch stops compiling after compiling once (laravel 8 homestead + Vue)
當我使用 npm 運行手表時,它會編譯我的更改並更新頁面,當我進行另一次編輯時,它也會編譯它。 但是,在第一次編輯之后,它將停止更新我的頁面。 我沒有收到任何錯誤。 當我退出它並運行 npm run watch 時,它會再次編譯這些更改,所以我認為不是我正在編輯的代碼導致它。
我嘗試過的事情:
這是我的混合文件:
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')
.vue()
.sass('resources/sass/app.scss', 'public/css');
這是我的 package.json:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"axios": "^0.21.1",
"bootstrap": "^4.0.0",
"browser-sync": "^2.26.14",
"browser-sync-webpack-plugin": "^2.3.0",
"jquery": "^3.2",
"laravel-mix": "^6.0.16",
"lodash": "^4.17.19",
"popper.js": "^1.12",
"postcss": "^8.1.14",
"resolve-url-loader": "^2.3.1",
"sass": "^1.20.1",
"sass-loader": "^8.0.0",
"vue": "^2.5.17",
"vue-loader": "^15.9.5",
"vue-template-compiler": "^2.6.10"
},
"dependencies": {
"vue-axios": "^3.2.4",
"vue-router": "^3.5.1"
}
}
我有同樣的問題,並嘗試了一切。 最終我發現問題在於我如何導入路由。
{
path: '/test',
name: 'test',
component: () => import("../views/pages/test.vue")
},
我忘了用大寫字母。
component: () => import("../views/pages/test.vue")
應該:
component: () => import("../views/pages/Test.vue")
顯然,當我運行“npm run watch”laravel 時,即使我寫了“test.vue”,也可以導入我的 Test.vue。 但是,在初始啟動 laravel 混合使用動態加載之后,如果我不使用大寫字母,它將忽略更改。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.