Skip to content

Commit b076bdf

Browse files
committed
Fix repl/importmap.js
1 parent 86d1d41 commit b076bdf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

repl/importmap.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
function importFile(content) {
66
return "data:text/javascript;base64," + btoa(content);
77
}
8-
const nodeModules = location.href + './node_modules/';
8+
const dir = location.origin + location.pathname.replace(/[a-z]+.html/, '');
9+
const nodeModules = dir + 'node_modules/';
910
// For React ESM importmap to work you need React ESM: npm i react-es6
1011
const react = {
1112
'prop-types' : nodeModules + 'react-es6/prop-types/index.js',

0 commit comments

Comments
 (0)