0

I'm using Qwik and I can't use dynamic import. Thus I have this line of code:

import { OverridenLayout } from 'BlogOverride'

This means that in my tsconfig.json file, I need to configure a barrel:

    "compilerOptions": {
        "paths": {
            "BlogOverride": [
                "src/Modules/Blog/Exports"
            ],

This means that the src/Modules/Blog/Exports file should be present, and it should export a named component called OverridenLayout.

This makes our life very difficult, because even if we don't want to override a layout, we need to include that file, and write some boilerplate code in it.

What can I do to make this dynamic layout loading possible, without boilerplate code?

  • How do you use the conditional export in your code? Also, while I know nothing about qwik, I don't see why you would be prevented from using dynamic imports which are available natively in evergreen browsers. – Aluan Haddad Aug 08 '23 at 02:53

0 Answers0