fix(vite): asset handling (#3225)
This PR reworks asset handling in our vite plugin. Importing assets in js is now supported.
This commit is contained in:
@@ -17,6 +17,8 @@ export function patches(): Plugin {
|
||||
return true;
|
||||
},
|
||||
transform(code, id, options) {
|
||||
if (!/\.([tj]sx?|[mc][tj]s)$/.test(id)) return;
|
||||
|
||||
const presets = [];
|
||||
if (!options?.ssr && /\.(tsx?|m[jt]s)$/.test(id)) {
|
||||
presets.push([babelReact, {
|
||||
|
||||
Reference in New Issue
Block a user