0

I am starting to use grunt-usemin and want to change the url inside this script where it says

baseUrl: "/script/" to 
baseUrl: "/prod/script/"

in my layout.html

<script type="text/javascript">
  var require = {
      baseUrl: "/script/",
      urlArgs : "cachebust={{version}}",
      deps : ['main']
  };
</script>

How do I configure grunt-usemin to do that ?

In my gruntfile.js I have

 useminPrepare: {
      html: ['../templates/layout.html']
    },
    usemin: {
      html: ['../templates/layout.html']
  }
4

1 回答 1

0

Grunt usemin 通常通过在文件名上使用哈希来消除缓存。这样也可以只缓存选择性的“构建”。假设您必须压缩文件并且只更改了一个文件,在这种情况下您将只有一个文件可以缓存。

于 2014-03-05T10:23:59.680 回答