When cleaning up the code like this
import weldIcon from "../icons/weld_18x18.svg" with { loader: "text" };
TSCO will remove the with part
import weldIcon from "../icons/weld_18x18.svg";
Which breaks the code.
As a workaround, I would be happy if TSCO would not touch import statements altogether, but it ignores settings for not optimizing imports.