title: spring.resources.chain.strategy.content.enabled only working on .css files
body: <p>I am trying to enable ContentVersionStrategy for JavaScript and CSS files within a Spring Boot application using Thymeleaf as the view engine.</p>
  <p>In a <a href="https://github.com/moose56/stackoverflow-cache-busting" rel="nofollow noreferrer">sample project</a> I have added the following to the application properties file:</p>
  <pre><code># add classpath:/custom/ as a possible location
  spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,classpath:/custom/
  
  # enable ContentVersionStrategy
  spring.resources.chain.strategy.content.enabled=true
  spring.resources.chain.strategy.content.paths=/**
  </code></pre>
  <p>This works for .css files in the application but not .js files. From what I can read it should also work on .js files.</p>
  <p>I have also tried to do this manually rather than just in the properties file with:</p>
  <pre class="lang-java prettyprint-override"><code>@Configuration
  public class WebConfiguration implements WebMvcConfigurer
  {
      private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
              &quot;classpath:/META-INF/resources/&quot;, &quot;classpath:/resources/&quot;,
              &quot;classpath:/static/&quot;, &quot;classpath:/public/&quot;, &quot;classpath:/custom/&quot;};
  
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry)
      {
          registry.addResourceHandler(&quot;/**&quot;).addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS)
                  .resourceChain(true)
                  .addResolver(new VersionResourceResolver().addContentVersionStrategy(&quot;/**&quot;));
      }
  }
  </code></pre>
  <p>But this does not work for .css files or .js.</p>
  <p>I have tried with with Spring Boot 2.1.4.RELEASE, 2.2.0.M2, 2.2.0.BUILD-SNAPSHOT, Java 11 and 12 just in case there were any differences.</p>
  <p>Any reason my the property file method does not seem to apply to .js files?</p>
  <p>Is there anything obviously wrong with my <code>WebMvcConfigurer</code> implementation that means it does not apply to either .css or .js?</p>