Skip to content
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

Completely replace gzipped file extension to just .js #34

Open
juanzitelli opened this issue May 4, 2023 · 1 comment
Open

Completely replace gzipped file extension to just .js #34

juanzitelli opened this issue May 4, 2023 · 1 comment

Comments

@juanzitelli
Copy link

juanzitelli commented May 4, 2023

Ability to Override Output File Extension

Currently, the plugin adds the .gz extension to compressed files by default. However, it would be useful to have the ability to completely override the output file extension to suit specific project requirements.

For example, it would be great to have the option to replace the default .js.gz extension with just .js This would allow for greater flexibility in configuring the plugin and output file naming conventions.

In case of configuring your vite config file to this:

output: {
	entryFileNames: '[name].js',
},

and then your vite compress plugin config to this:

viteCompression({
      algorithm: 'gzip',
      deleteOriginFile: true,
      ext: '.js',
    }),

the resulting files will have .js.js extension. Leaving ext to just an empty string ("") defaults the config to set .gz as the final file extension.

@juanzitelli juanzitelli changed the title Completely replace file extension Completely replace gzipped file extension to just .js May 4, 2023
@jglee96
Copy link

jglee96 commented Jun 5, 2023

How about try this, vite-plugin-compression2.

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

No branches or pull requests

2 participants