In my TypeScript, I'm importing a module as follows:
import swal from "sweetalert2";
When I compile the file to JavaScript, it outputs:
const sweetalert2_1 = require("sweetalert2");
Then I get a browser message:
'require is not defined'
Is there a way to get the JavaScript to compile without 'require'?