How to use pnp library in imported script

Hi!
Please help in the following matter.
I have a form on SP2019 and in its custom JS I import a custom script file. In that script file I would like to use the pnp library, but unfortunately I cannot. How to do this?
This is my custom JS on the form:

window.$ = $;
window.jQuery = jQuery;
window.pnp=pnp;
fd.spRendered(function() {
$.getScript('https://sharepoint.contoso.com/start/SiteAssets/MyScript.js')
});

This is the script file MyScript.js:

console.log('Script loads');
const web = new Web('https://sharepoint.contoso.com/start/');
console.log('Second log');
const items = await web.lists.getByTitle("Listname").items.select("ID,Title").top(1).get();
console.log(JSON.stringify(items));

In the console only the 'Script loads" text appears the 'Second log' text does not. If I do not use imported script file and put everything in the custom JS then it works. It seems I cannot use pnp library in the imported script.
What should I do?

Thanks!

Dear @Janos_Nagy,
Try adding the following line as well:

window.Web = Web;

Hi @Nikita_Kurguzov !
It worked great, thanks.
I actually found this post as well, could have found it sooner.
Thank you!