Skip to content Skip to sidebar Skip to footer
Showing posts with the label Es6 Modules

Detect Whether Es Module Is Run From Command Line In Node

When using CommonJS modules in Node, you can detect whether a script is being run from the command … Read more Detect Whether Es Module Is Run From Command Line In Node

Webpack Imported Module Is Not A Constructor

I created a small JS module which I intend to make an npm package, but for now is just on GitHub. T… Read more Webpack Imported Module Is Not A Constructor

Running Node With Loader Ts-node/esm.js Requires Imports To Have The .js Extension

I am trying to run node 14 with my package.json set as module: 'type': 'module', I… Read more Running Node With Loader Ts-node/esm.js Requires Imports To Have The .js Extension

Conditional Export In Es2015

Let's say you're developing a polyfill and don't want to shim a class if it already exi… Read more Conditional Export In Es2015

No Exported Symbols With Es6 Modules Library Compiled By Closure Compiler

Starting point: Many js files are successfully compiled (no warning/error) by Closure Compiler (ADV… Read more No Exported Symbols With Es6 Modules Library Compiled By Closure Compiler

Garbage Collect Unused Modules

I am using dynamic import to load scripts written by the user in the browser. I start by placing th… Read more Garbage Collect Unused Modules