Skip to content

Commit 48f57b1

Browse files
committed
update rn-bundler hack to prevent function name mangling
1 parent d3e46cd commit 48f57b1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg-hacks.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,13 @@ var hackers = [
135135
{
136136
name: 'rn-bundler',
137137
regex: [
138-
/react\-packager\/src\/bundler\/bundle\.js/i
138+
/react\-packager\/src\/bundler\/bundle\.js/i,
139+
/react\-packager\/src\/JSTransformer\/worker\/minify\.js/i,
139140
],
140141
hack: function (file, contents) {
141-
var fixed = contents.replace(/(fromString: true,)(\s+)(outSourceMap)/, '$1$2mangle:false,$2$3')
142+
if (contents.indexOf('mangle:false') !== -1) return
143+
144+
var fixed = contents.replace(/(\s+)(fromString: true,)/, '$1$2$1mangle:false,')
142145
return contents === fixed ? null : fixed
143146
}
144147
},

0 commit comments

Comments
 (0)