automatically add "react/"
This commit is contained in:
parent
3fed5dfdba
commit
c3e5319d47
@ -7,7 +7,7 @@
|
||||
{
|
||||
"react":"https://esm.sh/preact@10.15.1/compat",
|
||||
"react-original":"https://esm.sh/preact@10.15.1/compat",
|
||||
"@able/": "./"
|
||||
"able/": "http://localhost:1234/"
|
||||
},
|
||||
"tasks":
|
||||
{
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { Router, Switch, Case } from "able/iso-elements.tsx";
|
||||
|
||||
import React from "react";
|
||||
|
||||
const CTXString = React.createContext("lol");
|
||||
@ -35,9 +37,10 @@ export default ()=>
|
||||
{
|
||||
const [Store, Dispatch] = React.useReducer(reducer, {name:"seth", age:24} as Store, builder)
|
||||
return <CTXString.Provider value="intradestink">
|
||||
<Router.Provider>
|
||||
<div class="my-4 font-sans">
|
||||
<h1 class="font-black text-xl text-red-500">Title</h1>
|
||||
<h2 class="font-black text-blue-500">subtitle</h2>
|
||||
<h2 class="font-black text-blue-500 p-4">subtitle</h2>
|
||||
<p>
|
||||
<button onClick={e=>Dispatch(1)}>{Store.name}|{Store.age}?</button>
|
||||
</p>
|
||||
@ -48,5 +51,6 @@ export default ()=>
|
||||
<Outer>
|
||||
<Inner/>
|
||||
</Outer>
|
||||
</Router.Provider>
|
||||
</CTXString.Provider>;
|
||||
}
|
||||
|
@ -2,8 +2,9 @@
|
||||
"compilerOptions": { "lib": ["deno.window", "dom"] },
|
||||
"imports":
|
||||
{
|
||||
"react":"https://esm.sh/preact@10.15.1/compat",
|
||||
"entry":"./app.tsx"
|
||||
"react": "https://esm.sh/preact@10.15.1/compat",
|
||||
"able/": "http://localhost:1234/",
|
||||
"entry": "./app.tsx"
|
||||
},
|
||||
"tasks":
|
||||
{
|
||||
|
@ -53,6 +53,10 @@ const ImportMapReload =async()=>
|
||||
{
|
||||
console.log(`"react" specifier not defined in import map`);
|
||||
}
|
||||
else if(!json.imports["react/"])
|
||||
{
|
||||
json.imports["react/"] = json.imports["react"]+"/";
|
||||
}
|
||||
|
||||
ImportMap.imports = Configuration.Remap(json.imports, Configuration);
|
||||
console.log(ImportMap.imports);
|
||||
@ -70,12 +74,6 @@ let Configuration:Configuration =
|
||||
async Serve(inReq, inURL, inExt, inMap, inConfig){},
|
||||
Remap: (inImports, inConfig)=>
|
||||
{
|
||||
const reactURL = inImports["react"];
|
||||
const setting = Configuration.SWCOp?.jsc?.transform?.react;
|
||||
if(setting && reactURL)
|
||||
{
|
||||
setting.importSource = reactURL;
|
||||
}
|
||||
return inImports;
|
||||
},
|
||||
Shell(inReq, inURL, inExt, inMap, inConfig)
|
||||
|
Loading…
Reference in New Issue
Block a user