fix hmr-static! misc
This commit is contained in:
parent
102f8a74d2
commit
93d953877e
7
app.tsx
7
app.tsx
@ -1,8 +1,5 @@
|
||||
import ReactDOM from "react-dom/client";
|
||||
import React from "react";
|
||||
|
||||
|
||||
|
||||
export function App(){
|
||||
|
||||
const [countGet, countSet] = React.useState(2);
|
||||
@ -17,9 +14,7 @@ export const Other =()=>{
|
||||
return <p>other app component</p>
|
||||
}
|
||||
|
||||
export function Root()
|
||||
export default function Root()
|
||||
{
|
||||
return <div><h1>rooted</h1><App/><Other/></div>
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.body).render(<Root/>);
|
@ -64,11 +64,11 @@ const findNextExport =(inFile:string, inIndex=0, inLocal:Array<string>, inForeig
|
||||
}
|
||||
else
|
||||
{
|
||||
const members = inFile.substring(nextCharInd+1, endBracketInd).replace(/\s/g, '');
|
||||
const members = inFile.substring(nextCharInd+1, endBracketInd);
|
||||
members.split(",").forEach(part=>
|
||||
{
|
||||
const renamed = part.split(" as ");
|
||||
inLocal.push(renamed[1] || renamed[0]);
|
||||
inLocal.push((renamed[1] || renamed[0]).replace(/\s/g, ''));
|
||||
});
|
||||
}
|
||||
|
||||
@ -130,15 +130,16 @@ ${ foreign.join(";\n") }`;
|
||||
};
|
||||
|
||||
|
||||
// ///////////////////////////////////////////////
|
||||
// const [local, global] = Exports(`
|
||||
// // export in comment
|
||||
// export * from "react";
|
||||
// const fakeexport =()=>{};
|
||||
// export{ thing1 as remapped, thing2}
|
||||
// export { thing1 as remapped, thing2} from 'React';
|
||||
// export
|
||||
// export const func=()=>{};
|
||||
// `);
|
||||
//
|
||||
// console.log(local, global);
|
||||
///////////////////////////////////////////////
|
||||
const [local, global] = ModuleShape(`
|
||||
// export in comment
|
||||
export { A as B }
|
||||
export * from "react";
|
||||
const fakeexport =()=>{};
|
||||
export{ thing1 as remapped, thing2}
|
||||
export { thing1 as remapped, thing2} from 'React';
|
||||
export
|
||||
export const func=()=>{};
|
||||
`);
|
||||
|
||||
console.log(local);
|
@ -5,6 +5,11 @@
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module" src="/app.tsx"></script>
|
||||
<script type="module">
|
||||
import ReactDOM from "react-dom/client";
|
||||
import React from "react";
|
||||
import App from "/app.tsx";
|
||||
ReactDOM.createRoot(document.body).render(React.createElement(App));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user