Skip to content

Is it possible to load global script? #213

@unional

Description

@unional

I tried to load a file like this and failed:

(function() {
  window['MyCompany'] = {
    component: {}
  }

  const foo: string = 'foo'
  window['MyCompany'].component.foo = foo
}())

error: 'Missing initializer in const declaration'.
If I remove the type, i.e. from const foo: string = 'foo' to const foo = 'foo', it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions