Use webpack to package typescript files into js files, how can configuration solve the scope problem?

currently uses webpack in conjunction with typescript to develop a class library.
but there is a problem. When referencing the method in the packaged js file of ts in the outer html, there will be a problem that this function does not exist. I looked at the reason: there should be a scope problem after webpack packaging. Is there any way to solve this problem?


give an example

import XXX from 'XXX';
window.XXX=XXX;

just write like this


webpack is a module package and cannot reference the js file directly in html.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea1f3d-1b9a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea1f3d-1b9a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?