Alexander Weickmann
07/31/2020, 10:17 PMagrosner
07/31/2020, 10:17 PMAlexander Weickmann
07/31/2020, 10:26 PMAlexander Weickmann
07/31/2020, 10:27 PMAlexander Weickmann
07/31/2020, 10:30 PMRobert Jaros
07/31/2020, 10:43 PMandylamax
07/31/2020, 11:11 PMkotlin-frontend
plugin never had this issue at allturansky
07/31/2020, 11:34 PMAlexander Weickmann
07/31/2020, 11:59 PMAlexander Weickmann
08/01/2020, 12:01 AMAlexander Weickmann
08/01/2020, 12:23 AMandylamax
08/01/2020, 12:47 AMAlexander Weickmann
08/01/2020, 12:59 AM@file:JsModule("react-hot-loader/root")
package reacthotloader
@JsName("hot")
external fun hot(component: dynamic)
2 - Added dependencies to react-hot-loader and hot-loader/react-dom (instead of the actual react-dom) in the build.gradle.kts of the frontend module:
dependency("react-hot-loader")
dependency("@hot-loader/react-dom", reactVersion)
3 - Added .babelrc to the root of the project (no clue whether this is actually being picked up)
{
"plugins": [
"react-hot-loader/babel"
]
}
4 - Added frontend/webpack.config.d/react-hot-loader.js
config.resolve.alias = {
'react-dom': '@hot-loader/react-dom'
};
5 - Wrap the root react component with hot function
fun RBuilder.application() = child(Application::class) {
}
fun main() {
render(document.getElementById("content")) {
hot(application())
}
}
6 - And I have a frontend/webpack.config.d/babel.js looking like this:
config.module.rules.push({
test: /\.jsx?$/,
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader'
});
andylamax
08/01/2020, 1:19 AMAlexander Weickmann
08/01/2020, 1:57 AMandylamax
08/01/2020, 8:01 AM