How to use the @haul-bundler/core.HasteResolver 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
process.env.NODE_ENV === 'production'
          ? {}
          : {
              /**
               * Latest `react-proxy` version does not contain try/catches from
               * commit 981815dca250373619138c9f5aadf12295cf1b3f.
               */
              'react-proxy': '@zamotany/react-proxy',
            },
      plugins: [
        /**
         * React Native uses a module system called Haste
         * React Native uses haste internally, and additional RN
         * platform's require additional packages also provide haste modules
         */
        new HasteResolver({
          directories: providesModuleNodeModules.map((_: any) => {
            if (typeof _ === 'string') {
              if (_ === 'react-native') {
                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
github callstack / haul / packages / haul-preset-0.60 / src / defaultConfig.ts View on Github external
},
        __DEV__: dev,
      }),
      new webpack.LoaderOptionsPlugin({
        minimize: !!minify,
        debug: dev,
      }),
    ],
    resolve: {
      plugins: [
        /**
         * React Native uses a module system called Haste
         * React Native uses haste internally, and additional RN
         * platform's require additional packages also provide haste modules
         */
        new HasteResolver({
          directories: providesModuleNodeModules.map((_: any) => {
            if (typeof _ === 'string') {
              if (_ === 'react-native') {
                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