1 2 |
// .env VITE_IMG = 'https://url/static/img/' |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// vite.config.ts import { defineConfig, loadEnv } from 'vite' export default ({ mode }) => defineConfig({ css: { preprocessorOptions: { scss: { additionalData: `$imgUrl: '${loadEnv(mode, process.cwd()).VITE_IMG}';` } } } }) |
1 2 |
// scss background: url(#{$imgUrl}bg.png); |