about summary refs log tree commit diff
path: root/metro.config.js
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-06-15 17:40:18 -0500
committerPaul Frazee <pfrazee@gmail.com>2022-06-15 17:40:18 -0500
commit77b938845aa909a70f896b759b04ba7c1b1d9aa6 (patch)
tree0d5f65c3efa2c7702f4c5eee024248b73ec36f07 /metro.config.js
parentb2dd8d4f440243ac2eb12e7013d5a024b4e95f07 (diff)
downloadvoidsky-77b938845aa909a70f896b759b04ba7c1b1d9aa6.tar.zst
Polyfills for native crypto
Diffstat (limited to 'metro.config.js')
-rw-r--r--metro.config.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/metro.config.js b/metro.config.js
index 9c99c9e98..9dfaece89 100644
--- a/metro.config.js
+++ b/metro.config.js
@@ -11,9 +11,11 @@ console.log(metroResolver)
 module.exports = {
   resolver: {
     resolveRequest: (context, moduleName, platform) => {
+      // HACK
       // metro doesn't support the "exports" directive in package.json
       // so we have to manually fix some imports
       // see https://github.com/facebook/metro/issues/670
+      // -prf
       if (moduleName.startsWith('ucans')) {
         const subpath = moduleName.split('/').slice(1)
         if (subpath.length === 0) {
@@ -34,14 +36,19 @@ module.exports = {
           filePath,
         }
       }
+      // HACK
+      // this module has the same problem with the "exports" module
+      // but also we need modules to use our version of webcrypto
+      // so here we're routing to a module we define
+      // -prf
       if (moduleName === 'one-webcrypto') {
         return {
           type: 'sourceFile',
           filePath: path.join(
             context.projectRoot,
-            'node_modules',
-            'one-webcrypto',
-            'browser.mjs',
+            'src',
+            'platform',
+            'polyfills.native.ts',
           ),
         }
       }