2017-06-27 78 views
0

因此,laravel混合命令mix.copy似乎優化圖像,但是,我需要在完全相同的文件結構的圖像,所以我有公共目錄中的圖像文件夾,我想運行mix.copy這將優化圖像,並保持它們同一目錄中,但在這一刻,當我運行它消除第一圖像和拋出一個錯誤:Laravel混合.copy在同一目錄中?

Error: ENOENT: no such file or directory, open 'C:\xampp\htdocs\laravel\public\images\default.gif'

該文件在那裏運行NPM運行督促

mix.styles([ 
    'resources/assets/css/bootstrap-social.css', 
    'resources/assets/css/bootstrap.css', 
    'resources/assets/css/dropzone.css', 
    'resources/assets/css/jquery-ui.css', 
    'resources/assets/css/jquery-ui.structure.css', 
    'resources/assets/css/jquery-ui.theme.css', 
    'resources/assets/css/nav.css' 
], 'public/css/style.css'); 
mix.scripts([ 
    'resources/assets/js/pace.js', 
    'resources/assets/js/jquery.js', 
    'resources/assets/js/page-load.js', 
    'resources/assets/js/search.js', 
    'resources/assets/js/bootstrap.js', 
    'resources/assets/js/dropzone.js', 
    'resources/assets/js/image-upload.js', 
    'resources/assets/js/jquery-ui.js', 
    'resources/assets/js/googlemap.js', 
], 'public/js/script.js'); 
mix.copy("public/images/*.*", "public/images/"); 
mix.browserSync('http://localhost:8000'); 
+0

你能告訴我們你的代碼嗎? – Fahmi

+0

ssee我的編輯請 –

+0

和哪個laravel版本是這樣的? – Fahmi

回答

0

嘗試這種方式之前.. mix.copyDirectory('assets/img', 'public/img');此代碼應該可以工作。

+0

這個代碼應該放在哪裏?爲什麼這個代碼應該工作?多一點解釋可能有助於更好地理解。 – joanolo