39 lines
795 B
HTML
39 lines
795 B
HTML
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
</head>
|
|
<body>
|
|
<!--
|
|
<script type="module">
|
|
import * as PREACT from "./bundle.js";
|
|
console.log(PREACT);
|
|
</script>
|
|
-->
|
|
|
|
<!-- -->
|
|
<script type="module">
|
|
import Bundle, {ESBuild} from "./mod.js";
|
|
|
|
const {outputFiles} = await Bundle({
|
|
esBuild:{
|
|
entryPoints:["react"],
|
|
},
|
|
importMap:{
|
|
imports: {
|
|
"react": "https://esm.sh/preact@10.22.0/compat",
|
|
"react/": "https://esm.sh/preact@10.22.0/compat/"
|
|
}
|
|
}
|
|
});
|
|
|
|
for(const item of outputFiles){
|
|
// do something with the output...
|
|
console.log(item.text);
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html> |