Modules
Two module systems coexist in JS. "Coexist" is an exaggeration.
Even if there is one line of ES module syntax in the file, be it import
or export
, runtime assumes it to be ES, and then any conflicting CommonJS syntax will fail.
Two module systems coexist in JS. "Coexist" is an exaggeration.
Even if there is one line of ES module syntax in the file, be it import
or export
, runtime assumes it to be ES, and then any conflicting CommonJS syntax will fail.