This project uses a versioning system that embeds the version number in the filenames for better cache management.
- The version number is stored in
dist/version.jsand is extracted during the build process. - Webpack outputs the main bundle as
ultra-vehicle-card-[version].js(e.g.,ultra-vehicle-card-2.0-Beta1.js). - A reference file
ultra-vehicle-card.jsis created that simply imports the versioned file.
-
Update the version number in these files:
dist/version.js- Update both the comment and thesetVersion()callsrc/cards/ultra-vehicle-card.ts- Update thesetVersion()callpackage.json- Update the version field
-
Build the project:
npm run build
-
The build process will:
- Read the version from
dist/version.js - Generate
ultra-vehicle-card-[version].js - Create a reference file
ultra-vehicle-card.jsthat imports the versioned file
- Read the version from
-
For deployment, you can use:
npm run build:deploy
- Users always see the correct version in the browser console
- Cache busting is automatic with version changes
- Even if browsers cache the main entry file, it will always redirect to the current version
- Version number is consistent across all places it appears