Skip to content

Picture dimensions in file name #133

@AntoshJkeee

Description

@AntoshJkeee

Hello

Thank you for developing your product. I started using it to implement my projects.

I have the following question

I am using your Picture component from Minista

<Picture
    className="news__img-two"
    breakpoints={[1920]}
    src="/src/assets/images/check-desktop.jpg"
    artDirectives={[
    	{
          	media: `(min-width: 1920px)`,
          	src: "/src/assets/images/check-desktop.jpg",
          	formats: ['webp'],
          	breakpoints: [1920]
    	},
    	{
    		media: `(min-width: 1440px)`,
    		src: "/src/assets/images/check-laptop.jpg",
    		formats: ['webp'],
    		breakpoints: [1440]
    	},
    	{
    		media: `(min-width: 375px)`,
    		src: "/src/assets/images/check-mobile.jpg",
    		formats: ['webp'],
    		breakpoints: [375]
    	}
    ]}
    alt="check" />

In the build I get names with their sizes, for example check-desktop-1920x595.webp,

Is there any way to not add their sizes to the file name?

I tried to do this through the settings, but it didn't help me

export default defineConfig({
  assets: {
  outDir: 'assets',
  outName: '[name]',
  images: {
  	outDir: 'assets/images',
  	outName: '[name][extname]', `this`
  	...

I also tried to do it inside the Vite configuration, but still not working

vite: {
	resolve: {
	  extensions: ['.js', '.ts', '.tsx', '.jsx'],
	},
	build: {
	  rollupOptions: {
	    output: {
              assetFileNames: `assets/images/[name][ext]`, `this`
              chunkFileNames: `assets/[name].js`,
			},
		},
	},

},

Is there any way to not add the image size to the name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions