mesozoic icon indicating copy to clipboard operation
mesozoic copied to clipboard

Add root alias to fixture

Open d9k opened this issue 1 year ago • 1 comments

Using root alias with Ultra build which uses mesozoic causes problems: `/~/` alias + build => Module not found on runtime | issue #290 | ultra: entries for paths with aliases not created in .ultra/importMap.browser.json and importMap.server.json at all!

Please add root alias to fixture and resolve build errors.

For example:

importMap.json:

{
  "imports": {
       "/~/": "/src/",
   }
}

client.tsx, server.tsx:

replace

import App from "./src/app.tsx" with import App from "/~/app.tsx".

d9k avatar Dec 14 '23 11:12 d9k

If add alias as describe above deno task test fails with:

error: AssertionError: Snapshot does not match:

                       
    [Diff] Actual / Expected
                                                                                             
                                                                                             
    {                                                                                        
      imports: {                                                                             
+       "./client.tsx": "/client.0774b963.js",             
+       "./src/app.tsx": "/src/app.4051f35a.js",     
+       "./src/components/Test.tsx": "/src/components/Test.d8e044d9.js",                     
-       "./client.tsx": "/client.eaebf466.js", 
        "https://deno.land/": "https://deno.land/",                                          
        "https://esm.sh/": "https://esm.sh/",
        "react-dom/client": "https://esm.sh/v127/[email protected]/es2022/client.js",         
        "react/jsx-runtime": "https://esm.sh/stable/[email protected]/es2022/jsx-runtime.js",
+       "ultra/hooks/use-asset.js": "https://deno.land/x/[email protected]/hooks/use-asset.js", 
        "ultra/hydrate.js": "https://deno.land/x/[email protected]/hydrate.js",   
        react: "https://esm.sh/stable/[email protected]/es2022/react.mjs",       
+       twind: "https://esm.sh/v127/[email protected]/es2022/twind.mjs",
      },       
      scopes: {                               
        "https://deno.land/": {                                                              
          "/x/": "https://deno.land/x/",
        },                                    
        "https://esm.sh/": {                                                                 
          "/stable/": "https://esm.sh/stable/",    
          "/v127/": "https://esm.sh/v127/",
        },
      },
    }

As you see, "./src/app.tsx": "/src/app.4051f35a.js" disappears from imports

d9k avatar Dec 27 '23 21:12 d9k