Most voted "es6-modules" questions
The Javascript standard module system, specified from the Ecmascript 2015 (ES6) edition. Use this tag only when the question is directly related to any mechanism, feature or function related to Ecmascript modules.
Learn more…7 questions
Sort by count of
-
6
votes2
answers218
viewsAlternative to __filename and __dirname in Node.js with Ecmascript Modules
From more recent versions of Node.js, you can use the Ecmascript Modules standard (instead of the ancient Commonjs) for importing modules via extension .mjs or field type defined as module in the…
-
4
votes2
answers419
viewsWhat is the "module" value for in the type property of the HTML <script> element
I recently saw a code that includes a file Javascript was set the attribute type with the value module as in the example below: <script type="module" src="arquivo.js"></script> I would…
-
3
votes1
answer95
viewsHow to import content from a JSON within an ESM (Ecmascript modules) module in Node.js?
It is common for me to see online courses, articles and tutorials over the internet, Node.js codes that can import local JSON files into code to be manipulated, used, tested, etc... In these…
-
2
votes1
answer273
viewsHow to import and export members using Ecmascript modules in the browser?
I am trying to import a class, but I am making one or several mistakes. Can anyone enlighten me about? Filing cabinet js/calendar: export default class Calendar { constructor(date) {…
-
2
votes0
answers35
viewsCalling classes from strings in ES6 modules (commonjs) compiled by Webpack
In a web project with TypeScript, using modules commonjs, compiled via Webpack (version 5), I need to call classes and methods dynamically from type variables string containing their names. I can…
-
1
votes1
answer20
viewsFunction error not set when working with Ecmascript modules in the browser
I am trying to work with modules in Javascript and came across a problem when calling a function that is in the file main.js for index.html. <!doctype html> <html lang="en"> <head>…
-
1
votes0
answers24
viewsHow does it work and what are the implementing context rules for Ecmascript 6 modules (ESM)?
Since Ecmascript 5, Javascript has traditionally had two execution contexts: Sloopy mode (informal name used to refer mode enabled by default in most execution contexts). Strict mode, explicitly…