我有以下结构(我正在使用 Django)。
app
|__ templates
|__ index.html
|__ static
|__ js
|__ main.js
我需要做的是:
- 丑化/缩小
main.js
成main.min.js
- 文件转
main.min.js
成类似main.min.12345678.js
- 确保
index.html
有新main.min.12345678.js
文件
我的index.html
样子:
// ....
<script src="{% static "js/main.js" %}"</script>
</body>
</html>
我正在尝试 Grunt filerev (https://github.com/yeoman/grunt-filerev)并且我能够正确运行它,但是如何main.js
用版本化的替换它main.js
?
我尝试使用 grunt usemin,但是有没有一种方法可以让我不必创建新index.html
文件?