plasticine / inject-loader

💉📦 A Webpack loader for injecting code into modules via their dependencies.
https://www.npmjs.com/package/inject-loader
MIT License
482 stars 47 forks source link

Not working with React Native packager? #51

Closed jarecsni closed 6 years ago

jarecsni commented 6 years ago

Tried the simplest of cases, something like

const injector = require('inject-loader!./SomeModule')

Got the below exception

Cannot find module 'inject-loader!./ExerciseExternalView' from 'ExerciseExternalView.spec.js'

  at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)

Not sure if inject-loader is supposed to work with RN?

plasticine commented 6 years ago

@jarecsni This is expected — React Native does not use Webpack, instead bundles code with https://github.com/facebook/metro

inject-loader only works with Webpack.