翠 / green

Results 246 comments of 翠 / green

Does these work for you? https://www.npmjs.com/package/vite-plugin-svg-sprite https://github.com/vbenjs/vite-plugin-svg-icons

> Unfortunately they do not suit as they require a JS framework. I don't think they require a JS framework. Won't vite-plugin-svg-sprite work by this code? ```js import appIconId from...

> Ah, Vite's build script doesn't work on the reproduction on stackblitz, but it works correctly locally. It seems to happen because `dependencies` field was upper case. If I fix...

I was able to reproduce with that. I trimmed down the reproduction and clarified the issue description.

By concatenating CSS files before minifying, esbuild can apply cross-file optimizations. For example, duplicates can be removed ([esbuild try](https://esbuild.github.io/try/#dAAwLjIwLjEALS1taW5pZnkgLS1sb2FkZXI9Y3NzAC5mb28geyBjb2xvcjogYmx1ZTsgfQouYmFyIHsgY29sb3I6IHJlZDsgfQouZm9vIHsgY29sb3I6IGJsdWU7IH0KLmJhciB7IGNvbG9yOiByZWQ7IH0)). Since we are simply concatenating the files, I guess we can...

We can map the position back to the original position by using source maps. But I think it's fine to leave it for now since we don't support CSS source...

I tested by adding ```css { color: blue; } ``` to `playground/css/mod.module.css` and running `vite build`. I guess the line calculation is wrong.

> From this point, where the css is parsed and minimized, making the warning more accurate is beyond my ability 😥. That part is fine. If I append the following...

No problem 😃 Don't we always need to append a line break at the end? Otherwise, we'll have more than one file mapped to a line and then we cannot...

A workaround is to use `import * as babel from '@babel/standalone'`.