Open marcog83 opened 5 years ago
['babel-plugin-rewire', {ignoredIdentifiers: ['hasOwnProperty']}]
should fix you issue
In my case, the problem was an exclude
config passed from my webpack configuration for the babel loader:
{
test: /\.[jt]sx?$/,
exclude: /node_modules\/(?!ABC\/).*/, // <- \/ is not enough, something like [\/\\] can work
}
Since those expressions are applied directly to the path, you need to make the expression match both, or you can get the path separator programatically.
I compiled my current project with the babel-plugin-rewire.
I get ReferenceError: _get__ is not defined when i try to run it on windows 10
On ubuntu and Mac it everything works, so I compared the final js file and I found that on Windows the plugin transpiles
and on Mac / Ububntu
As you can see in the first case I have
_get__(\"hasOwnProperty\")
and in the secondhasOwnProperty
my package.json
my babel config looks like the follow