Skip to content

Commit 2261016

Browse files
committed
avoid issues with bundlers
1 parent 647bc2c commit 2261016

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

idom/client/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "idom-client-react",
33
"description": "A client for IDOM implemented in React",
4-
"version": "0.5.2",
4+
"version": "0.5.3",
55
"author": "Ryan Morshead",
66
"license": "MIT",
77
"repository": {

idom/client/app/src/layout.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ function eventHandler(sendEvent, eventSpec) {
194194
function useLazyModule(source, sourceUrlBase = "") {
195195
const [module, setModule] = react.useState(null);
196196
if (!module) {
197-
import(joinUrl(sourceUrlBase, source)).then(setModule);
197+
// use eval() to avoid weird build behavior by bundlers like Webpack
198+
eval(`import("${joinUrl(sourceUrlBase, source)}")`).then(setModule);
198199
}
199200
return module;
200201
}

0 commit comments

Comments
 (0)