Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/app/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,18 @@ module.exports = mergeConfig(getDefaultConfig(__dirname), {
path.resolve(packageRoot, 'node_modules'),
],
},
transformer: {
/**
* @note Disable inline requires to match the default of "@expo/metro-config".
* This is the stricter mode: every import is evaluated eagerly, in order.
*/
getTransformOptions: async () => {
return {
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}
},
},
})
9 changes: 7 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['src/index.ts'],
entry: ['src/**/*.{ts,js}'],
/**
* @note Do not bundle the modules. Bundling inlines the polyfills into
* the entry module, hoisting the "msw" and interceptor imports above them.
* Metro then evaluates those before the polyfills unless "inlineRequires" is on.
*/
bundle: false,
format: ['esm'],
platform: 'neutral',
outDir: 'lib',
external: ['msw', /^@mswjs\/.+/, /^react-native(?:\/|$)/],
clean: true,
sourcemap: true,
onSuccess: 'tsc --project tsconfig.build.json',
Expand Down
Loading