Thanks a lot, I'm going to use my build tool to accomplish this, just wanted to make sure I wasn't missing something here.

--
Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.
Am 12.01.21, 19:01 schrieb Brian Raymes <[email protected]>:

As others have stated, there are other ways to do this. Here is how I’m doing it with maven:

 

In my case, I’m currently using a timestamp to try to avoid caching. Feel free to replace with a version, etc.

 

This will update the template and build time.

 

  <properties>

    <timestamp>${maven.build.timestamp}</timestamp>

  </properties>

 

 

      <plugin>

        <groupId>com.google.code.maven-replacer-plugin</groupId>

        <artifactId>replacer</artifactId>

        <version>1.5.3</version>

        <executions>

          <execution>

            <phase>package</phase>

            <goals>

              <goal>replace</goal>

            </goals>

          </execution>

        </executions>

        <configuration>

          <ignoreMissingFile>false</ignoreMissingFile>

          <file>${basedir}/target/_javascript_/bin/js-debug/index.html</file>

          <replacements>

            <replacement>

              <token><![CDATA[App.js]]></token>

              <value><![CDATA[App.js?v=${timestamp}]]></value>

            </replacement>

            <replacement>

              <token><![CDATA[App.css]]></token>

              <value><![CDATA[App.css?v=${timestamp}]]></value>

            </replacement>

          </replacements>

        </configuration>

      </plugin>

 

Brian

 

From: lol lol <[email protected]>
Sent: Tuesday, January 12, 2021 1:47 AM
To: [email protected]
Subject: [EXTERNAL] CSS & JS file versioning

 

Hi All,

 

Is there any possibility defined that lets me define my own placeholders in the html-template?

For example im using an html template with the following line

 

    <link rel="stylesheet" type="text/css" href="">

 

Is there anything helpful already existing in the compiler so I can add a version to my css like so:

 

href="" />

 

Thank!


Reply via email to