Laravel混合版本控制不会删除旧的内置文件 [英] Laravel mix versioning doesn't remove old built files

查看:102
本文介绍了Laravel混合版本控制不会删除旧的内置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel 5.4和mix来对我的javascript和scss文件进行版本控制. 问题是:它不会清除以前生成的文件,而只是添加一个具有不同文件名的新文件,即app.9d3e179e85922aad6ccf.js

I am using Laravel 5.4 with mix to version my javascript and scss files. The problem is: it doesn't clean the previous built files and simply add a new one with a different file name i.e. app.9d3e179e85922aad6ccf.js

在我开始的新项目中,我没有这个问题. Mix正确地将旧文件替换为最新的构建版本.

In a new project I started, I do not have this issue. Mix correctly replaces the old file with the latest built version.

在哪里可以进行更改?

推荐答案

这是laravel-mix库的问题,无法在此处解决. GitHub上有许多涉及同一问题的未解决问题.您可以检查最新的一些解决方法,直到官方图书馆获得永久性的修复.

This is an issue with the laravel-mix library which can't be addressed here. There are many open issues on GitHub referring to the same problem. You can check the most recent one for some workarounds till the official library gets a permanent fix.

https://github.com/JeffreyWay/laravel-mix/issues/814

可能的解决方案,以防将来链接失效.

Possible solutions in case the link doesn't work in the future.

目前几乎没有可能的解决方案.

There are few possible solution for now.

  1. 让文件进入默认目录.

  1. Let files go in default directories.

js mix.js('./resources/assets/js/app.js', 'public/js/app.js')

告诉npm在构建新文件夹之前删除您的bundle文件夹

Tell npm to delete your bundle folder before building new

这篇关于Laravel混合版本控制不会删除旧的内置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆