How to use pnp library in imported script

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;
fd.spRendered(function() {

This is the script file MyScript.js:

console.log('Script loads');
const web = new Web('');
console.log('Second log');
const items = await web.lists.getByTitle("Listname")"ID,Title").top(1).get();

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?


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!