Closed TobiasKoller closed 1 year ago
Ok I finally found a solution after search for hours. when putting this in the webpack-config it adds it to the window-variable.
...
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
globalObject: "this",
library: "My",
libraryTarget: "window",
},
and then I had to remove the "My"
from my Namespace because its already the key in the "library"-setting.
export namespace NP{
export function MyFunction(){}
}
after that I'm able to access it on my website through My.NP.MyFunction()
Expected Behaviour
when using
MyFunction should be accessable through
My.NP.MyFunction()
Actual Behaviour
The First part of the namespace (here My) gets replaced with a random character. Depending on the configuration it's preserving the namespace but its not accessable through My.NP.MyFunction..
Steps to Reproduce the Problem
create a typescript-file and use a namespace with a dot-separator
Location of a Minimal Repository that Demonstrates the Issue.