【发布时间】:2014-06-06 21:06:36
【问题描述】:
我有以下结构(我正在使用 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 文件?
【问题讨论】:
-
当您说“将
main.js替换为版本化的main.js”时,您的意思是“将main.min.js替换为版本化的main.min.js”吗?
标签: gruntjs grunt-usemin