Skip to content

Commit

Permalink
Fix path when loading js module
Browse files Browse the repository at this point in the history
  • Loading branch information
rossning92 committed Sep 3, 2022
1 parent a8a9867 commit 5f324d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,16 @@ function App() {
iframeNew.style.left = '0';
iframeNew.style.width = '100%';
iframeNew.style.height = '100%';
iframeNew.src = document.URL;
containerRef.current.appendChild(iframeNew);

const doc = iframeNew.contentWindow.document;
doc.open();
doc.write('<html><body>');
doc.write(`<script type="importmap">
{
"imports": {
"movy": "/movy.js"
"movy": "./movy.js"
}
}
</script>`);
Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function generateConfig({ name, entry, plugins = [], outputModule = false } = {}
type: outputModule ? 'module' : 'umd',
},
umdNamedDefine: true,
publicPath: '/',
},
module: {
rules: [
Expand Down

0 comments on commit 5f324d3

Please sign in to comment.