Skip to content

Commit 9e083df

Browse files
author
Rishabh Karnad
committed
Added comments to make issue tracking easier
1 parent b71d06d commit 9e083df

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,16 @@ function removeExistingDirectory(directoryName) {
164164
);
165165
}
166166

167+
// Get the `sourceExts` from the default metro configuration
168+
// Returns an array like ['js', 'json', 'ts', 'tsx']
167169
async function getSourceFileExtensions() {
168170
const { getDefaultConfig } = require(`${process.cwd()}/node_modules/metro-config/src/index.js`);
169171
const {
170172
resolver: { sourceExts: defaultSourceExts }
171173
} = await getDefaultConfig();
172174

173175
const sourceExts = union(defaultSourceExts, constantObjects.vueFileExtensions);
176+
// `sourceExts` now looks like ['js', 'json', 'ts', 'tsx', 'vue']
174177

175178
return sourceExts;
176179
}
@@ -293,6 +296,10 @@ async function setupVueNativeApp(projectName, cmd, isCrna = false) {
293296

294297
const sourceExts = await getSourceFileExtensions();
295298

299+
// Modify the app.json file to add `sourceExts`
300+
// Adding `sourceExts` to metro.config.js stopped working for certain
301+
// versions of Expo
302+
// This fixes #23
296303
expoObj.expo.packagerOpts = {
297304
config: 'metro.config.js',
298305
sourceExts: sourceExts,

0 commit comments

Comments
 (0)