• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Welcome to the world of Anagram Engineering
  • Who we are
  • Leistungen
    • Web Development
    • Embedded Systems
  • References
    • Customers
    • Webdesign & Webapps
    • Mobile Apps
    • Embedded Systems
    • Cloud Apps
  • News

Search

Anagram Engineering

Webdesign und Softwarelösungen aus Vorarlberg. Ihr Partner für innovative Lösungen rund ums Internet. Full Service Agentur.

January 11, 2018 by Harald

Ionic cache busting – Webpack

Out of the box, ionic webpack generates [nr].js files. When running in a browser these files are most probably cached. The following text explains a not perfectly dry but still reasonable solution.

First copy
node_modules\@ionic\app-scripts\config
to a the config folder of your app. Change the generated name and add a random (or not so random) string, i used the version identifier

...
var versionNr = 'v0.0.1';
... 
var prodConfig = {
  entry: process.env.IONIC_APP_ENTRY_POINT,
  output: {
    ...
    filename: '[name]-' + versionNr + '.js',
    devtoolModuleFilenameTemplate: ionicWebpackFactory.getSourceMapperFunction(),
  },
  ... 
  // do the same for devConfig 
  ...

In your package.json configure webpack to use the file you changed

{
    "name": "my-awesome-app",
    "version": "0.0.1",
    "author": "Anagram Engineering",
    "homepage": "http://anagram.at/",
    "private": true,
    "config": {
        "ionic_copy": "./config/copy.config.js", // a custom copy scripts - not required 
        "ionic_webpack": "./config/webpack.config.js" // tell ionic to use the adapted webpack configuration
    },

You will also need to change the index.html an tell it to use the generated version

   
    ... script src="build/polyfills.js" ...
    ... script src="build/vendor-v0.0.1.js" ...
    ... script src="build/main-v0.0.1.js" ...

This is working with partials and lazy loading enabled.

Filed Under: Wissenstransfer

About Harald Entner

Since january 2013 Harald is CEO of Anagram Engineering.

After he has finished his study in computer science at the Technical Universicty of Vienna he worked in Vienna, Munich and Dornbirn as software engineer, software architect and system developer.

Today he enjoys travelling, learning new languages and frameworks, systems, environments and tries to educate hilmself within these domains.

Primary Sidebar

Recent Posts

  • Zumtobel PROset App | Rebranding February 3, 2021
  • Speed matters July 2, 2019
  • Vienna calling June 18, 2019
  • Resclite Pro April 12, 2019
  • Zumtobel PROset App April 10, 2019

Legal

  • AGB
  • Impressum

Footer

Contact US

Stiegstrasse 24
6830 Rankweil

+43 650 925 62 64

About US

Anagram Engineering develops software for Web, Mobile, Tablet and embedded devices.

Learn More

© 2026 · Anagram Engineering

  • terms & conditions
  • impress
  • customers
  • References
  • who we are
  • Deutsch
  • English