How to use the @haul-bundler/core.AssetResolver function in @haul-bundler/core

To help you get started, we’ve selected a few @haul-bundler/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github callstack / haul / packages / haul-preset-0.59 / src / defaultConfig.ts View on Github external
return path.join(
                  resolveModule(root, 'react-native'),
                  'Libraries'
                );
              }
              return resolveModule(root, _);
            }
            return path.join(resolveModule(root, _.name), _.directory);
          }),
          hasteOptions: hasteOptions || {},
        }),
        /**
         * This is required by asset loader to resolve extra scales
         * It will resolve assets like image@1x.png when image.png is not present
         */
        new AssetResolver({ platform, runtime }),
      ],
      /**
       * Match what React Native packager supports.
       * First entry takes precedence.
       */
      mainFields: ['react-native', 'browser', 'main'],
      aliasFields: ['react-native', 'browser', 'main'],
      extensions: [
        `.${platform}.js`,
        `.${platform}.jsx`,
        '.native.js',
        '.native.jsx',
        '.js',
        '.jsx',
        `.${platform}.ts`,
        `.${platform}.tsx`,
github callstack / haul / packages / haul-preset-0.60 / src / defaultConfig.ts View on Github external
return path.join(
                  resolveModule(root, 'react-native'),
                  'Libraries'
                );
              }
              return resolveModule(root, _);
            }
            return path.join(resolveModule(root, _.name), _.directory);
          }),
          hasteOptions: hasteOptions || {},
        }),
        /**
         * This is required by asset loader to resolve extra scales
         * It will resolve assets like image@1x.png when image.png is not present
         */
        new AssetResolver({ platform, runtime }),
      ],
      /**
       * Match what React Native packager supports.
       * First entry takes precedence.
       */
      mainFields: ['react-native', 'browser', 'main'],
      aliasFields: ['react-native', 'browser', 'main'],
      extensions: [
        `.${platform}.js`,
        `.${platform}.jsx`,
        '.native.js',
        '.native.jsx',
        '.js',
        '.jsx',
        `.${platform}.ts`,
        `.${platform}.tsx`,