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

Does not refer to the build assetInlineLimit settings from vite-plugin version 5. #1551

Open
2 tasks done
hoiheart opened this issue Feb 18, 2025 · 0 comments
Open
2 tasks done

Comments

@hoiheart
Copy link

Describe the bug

Hello.

Posting the vite-plugin version of my project to 5, I found some different behavior than before.

1. It does not follow the build assetsInlineLimit settings set in vite.config.ts.

I set assetsInlineLimit to 0, and if you import the image from *.css.ts and use it as a background, it will be applied as base64 data image unlike before.

2. Doublequote does not auto wrap when using the imported image.

If use svg, the base64 code is not valid and must wrap the doublequote.

import { style } from '@vanilla-extract/css';
import asset from './logo.svg';

export const logo = style({
  background: `url("${asset}") no-repeat 50% 50%`,// If use svg, the base64 code is not valid and must wrap the doublequote.
  // background: `url(${asset}) no-repeat 50% 50%`, ❌
});

I created a link to the sample codesandbox.
Please check vite.config.ts and App.css.ts.

Thanks.

Reproduction

https://codesandbox.io/p/devbox/vite-react-ts-forked-f5v63m

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (2) x64 AMD EPYC
    Memory: 2.05 GB / 4.14 GB
    Container: Yes
    Shell: Unknown
  Binaries:
    Node: 20.9.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.8.1 - /usr/local/bin/npm
    pnpm: 8.10.2 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    @vanilla-extract/css: 1.17.0 => 1.17.0 
    @vanilla-extract/vite-plugin: 5.0.1 => 5.0.1 
    vite: ^2.2.3 => 2.3.3

Used Package Manager

yarn

Logs

Validations

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

No branches or pull requests

1 participant