DEV Community

Beey
Beey

Posted on

I tried putting commonJS in a .mjs file heres what happens

Table of contents

What I did

I tried running this commonJS in VS code but with a twist:


const vscode = require('vscode');

Enter fullscreen mode Exit fullscreen mode

The twist

The twist.. I put this in a .mjs file this is not for commonJS its for ES modules.

What happened

Nothing serious happened, The only thing that happened was me being told it was a commonJS module and it can be switched to a ES module.

Top comments (0)