Responsible JavaScript

Responsible JavaScript

Jeremy Wagner

module.exports = scriptUrls => scriptUrls.map(url => '<script src="${url}"></script>'); // /app.js const buildScriptTags = require("./js/build-script-tags.js"); These differences may seem superficial. They’re not. For one, ESM is supported in browsers and in later versions of Node.js, while CommonJS is only supported in Node.js. Second—and this is the kicker—CommonJS modules can’t be statically analyzed. This is because both CommonJS’s
2362-2368