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";
|
import React from "react";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function App(){
|
export function App(){
|
||||||
|
|
||||||
const [countGet, countSet] = React.useState(2);
|
const [countGet, countSet] = React.useState(2);
|
||||||
@ -17,9 +14,7 @@ export const Other =()=>{
|
|||||||
return <p>other app component</p>
|
return <p>other app component</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Root()
|
export default function Root()
|
||||||
{
|
{
|
||||||
return <div><h1>rooted</h1><App/><Other/></div>
|
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
|
else
|
||||||
{
|
{
|
||||||
const members = inFile.substring(nextCharInd+1, endBracketInd).replace(/\s/g, '');
|
const members = inFile.substring(nextCharInd+1, endBracketInd);
|
||||||
members.split(",").forEach(part=>
|
members.split(",").forEach(part=>
|
||||||
{
|
{
|
||||||
const renamed = part.split(" as ");
|
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(`
|
const [local, global] = ModuleShape(`
|
||||||
// // export in comment
|
// export in comment
|
||||||
// export * from "react";
|
export { A as B }
|
||||||
// const fakeexport =()=>{};
|
export * from "react";
|
||||||
// export{ thing1 as remapped, thing2}
|
const fakeexport =()=>{};
|
||||||
// export { thing1 as remapped, thing2} from 'React';
|
export{ thing1 as remapped, thing2}
|
||||||
// export
|
export { thing1 as remapped, thing2} from 'React';
|
||||||
// export const func=()=>{};
|
export
|
||||||
// `);
|
export const func=()=>{};
|
||||||
//
|
`);
|
||||||
// console.log(local, global);
|
|
||||||
|
console.log(local);
|
@ -5,6 +5,11 @@
|
|||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user