Skip to content

Keep original filename patterns #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daun
Copy link

@daun daun commented Jun 17, 2025

Currently, the plugin has output filenames hardcoded to 'assets/[name].[ext]?v=[hash]'. This PR would allow custom filename conventions by transforming the configured options instead of overwriting them. It detects the length of the hash and intelligently moves it to the query part, unless already set up correctly.

A few examples how the filename patterns are transformed:

In Out Notes
assets/[name]-[hash].js assets/[name].js?v=[hash] Moved hash to quer
assets/[name]-[hash].[ext] assets/[name].[ext]?v=[hash] Moved hash to query
assets/[name].[ext] assets/[name].[ext]?v=[hash] Added hash as query
assets/[name]-[hash].[ext] assets/[name].[ext]?v=[hash] Moved hash to query
assets/[name]-[hash:10].[ext] assets/[name].[ext]?v=[hash:10] Moved custom hash to query
assets/[name]-[hash][extname] assets/[name][extname]?v=[hash] Moved hash to query
assets/[name]-[hash:10][extname] assets/[name][extname]?v=[hash:10] Moved custom hash to query
assets/[name].js?v=[hash] assets/[name].js?v=[hash] No change - already in query
assets/[name].[ext]?v=[hash] assets/[name].[ext]?v=[hash] No change - already in query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant