You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn’t prevent you from writing import foo = require("mod") in a .mts file in --module commonjs. All it sees is that you wrote CJS syntax in a module format that’s going to emit CJS, so you’re good. Nothing cares about the file extension in --module commonjs, which is the problem.
Activity
fatcerberus commentedon Aug 4, 2023
Isn’t that what
verbatimModuleSyntaxdoes?andrewbranch commentedon Aug 4, 2023
It doesn’t prevent you from writing
import foo = require("mod")in a.mtsfile in--module commonjs. All it sees is that you wrote CJS syntax in a module format that’s going to emit CJS, so you’re good. Nothing cares about the file extension in--module commonjs, which is the problem.