react and reactdom in webpack + window
This commit is contained in:
parent
1cf3433a88
commit
1cdc0efc9c
|
@ -0,0 +1 @@
|
|||
module.exports = window.ReactDOM
|
|
@ -0,0 +1 @@
|
|||
module.exports = window.React
|
|
@ -29,7 +29,11 @@ module.exports = {
|
|||
modules: [
|
||||
path.resolve("src", "builtins"),
|
||||
path.resolve("src", "modules")
|
||||
]
|
||||
],
|
||||
alias: {
|
||||
react$: path.resolve(__dirname, "src", "react.js"),
|
||||
"react-dom$": path.resolve(__dirname, "src", "react-dom.js")
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -45,6 +49,10 @@ module.exports = {
|
|||
}
|
||||
}], "@babel/react"]
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
use: ['@svgr/webpack'],
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -44,6 +44,20 @@ async function privateInit(){
|
|||
//disabling sentry
|
||||
BDModules.get(e => e.getCurrentHub)[0].getCurrentHub().getClient().getOptions().enabled = false
|
||||
|
||||
// setting react in require cache
|
||||
try{
|
||||
window.React = require("react")
|
||||
}catch(e){
|
||||
const React = ModuleLoader.get(e => !["Component", "PureComponent", "Children", "createElement", "cloneElement"].map(c => !!e[c]).includes(false))[0]
|
||||
window.React = React
|
||||
}
|
||||
try{
|
||||
window.ReactDOM = require("react-dom")
|
||||
}catch(e){
|
||||
const ReactDOM = ModuleLoader.get(e => e.findDOMNode)[0]
|
||||
window.ReactDOM = ReactDOM
|
||||
}
|
||||
|
||||
let original = BDModules.get((e) => e.createSound)[0].createSound
|
||||
BDModules.get((e) => e.createSound)[0].createSound = function(sound){
|
||||
let isCalling = sound === "call_ringing_beat" || sound === "call_ringing"
|
||||
|
@ -55,9 +69,9 @@ async function privateInit(){
|
|||
},
|
||||
set(data){
|
||||
console.log("Attempting to set call_ringing value. Canceling "+data)
|
||||
}
|
||||
},
|
||||
configurable: false
|
||||
})
|
||||
console.log(returned)
|
||||
return returned
|
||||
}else{
|
||||
return original(...arguments)
|
||||
|
|
Loading…
Reference in New Issue