Skip to content

What is the proper way of importing modules in typescript (ECMAScript 2015)? #199

@UndeadKernel

Description

@UndeadKernel

When using ECMAScript 2015, import statements are lexically bound. That is, everything inside a module must be either declared or imported by a module. There is no such thing as globals outside of the module.

The modules of jsPanel assume that the jsPanel object exists in the global scope. Due to this, the following lines of code result in an error:

import jsPanel from "dist/jspanel.js"
import "dist/extensions/modal/jspanel.modal.js"

The last import triggers an error because jsPanel is not defined.

What is the appropriate way of using modules in this context?
For reference, I'm building a web application with vue3 and typescript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions