Lilact
    Preparing search index...

    Function require

    • Loads a jsx script from a path. All scripts can access Lilact namespace as a global object.

      Lilact.require loads synchronously, as it is expected to be loaded on the next instruction.

      As running the transpiled scripts rely on new Function, it is not possible to use module imports and exports. So to import you should use const {useState} = Lilact convention. And to export, you should use module.exports = .... Lilact.require returns module.exports value so you can import different modules using the convention above.

      If the path is in the format #id, it will query the document for a script element with the given id and run its contents.

      If require is called inside the function given to lazy, it will run async. See lazy.

      Parameters

      • path: any

        The path to the required file. Must be either absolute path or relative to the current document’s URL (the page/location that initiated the request).

      • forceUpdate: any

        To treat the code as inline. The main difference at the moment is that inline code doesn't include sourcemap.

      Returns any

      An array representation of the children.