所以 laravel mix 命令 mix.copy 似乎可以优化图像但是,我需要完全相同的文件结构中的图像,所以我在公共目录中有图像文件夹,我想运行 mix.copy 来优化图像并保持它们相同目录,但是此时当我运行它时,它会删除第一个图像并引发错误:
错误:ENOENT:没有这样的文件或目录,打开 'C:\xampp\htdocs\laravel\public\images\default.gif'
该文件在运行 npm run prod 之前就在那里
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');