Skip to content

Commit af7c2be

Browse files
committed
Fix to ignore css from assetExts
1 parent 1e947a5 commit af7c2be

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/plugin/metro.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import Metro from "metro";
33
const babelTransformerPath = require.resolve("./transformer");
44
const sourceExts = ["js", "ts", "jsx", "tsx"];
55
const imageExts = ["bmp", "gif", "png", "jpg", "jpeg", "webp", "svg"];
6+
const assetExts = [...imageExts, "css"];
67

78
export const bundle = async (filename) => {
89
const config = await Metro.loadConfig();
9-
config.resolver.sourceExts = [...sourceExts, ...imageExts, "css"];
10+
config.resolver.sourceExts = [...sourceExts, ...assetExts];
1011
config.resolver.assetExts = config.resolver.assetExts.filter(
11-
(ext) => !imageExts.includes(ext)
12+
(ext) => !assetExts.includes(ext)
1213
);
1314
config.transformer.babelTransformerPath = babelTransformerPath;
1415

0 commit comments

Comments
 (0)