Skip to content

Commit 72d95df

Browse files
authored
fix: enable package exports for metro. fixes #842 (#843)
1 parent ebe4512 commit 72d95df

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/build-templates.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ jobs:
193193
working-directory: ${{ env.work_dir }}
194194
if: matrix.type.language == 'js'
195195
run: |
196+
# Clean up built JS files
197+
# So we test that bundling works without any pre-built files
198+
rm -rf lib/*
199+
196200
yarn example expo export --platform web
197201
198202
- name: Install JDK

packages/create-react-native-library/templates/expo-library/example/metro.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const root = path.resolve(__dirname, '..');
1010
*
1111
* @type {import('metro-config').MetroConfig}
1212
*/
13-
module.exports = withMetroConfig(getDefaultConfig(__dirname), {
13+
const config = withMetroConfig(getDefaultConfig(__dirname), {
1414
root,
1515
dirname: __dirname,
1616
});
17+
18+
config.resolver.unstable_enablePackageExports = true;
19+
20+
module.exports = config;

0 commit comments

Comments
 (0)