DEV Community

loading...

Discussion on: ES6 Import And Export Cheatsheet

Collapse
myogeshchavan97 profile image
Yogesh Chavan Author

@akman If you're using any module bundler like webpack which React.js uses then you don't need to include the .js extension as it's optional. If want to use Es6 Import-export syntax inside Node.js then you may need to add .mjs extension as by default Node.js supports commonJS syntax and not ES Module syntax.

Collapse
akman profile image
Giannis Akmanidis

probably… but i use native JavaScript modules and not bundlers so i have to use extensions

Thread Thread
myogeshchavan97 profile image
Yogesh Chavan Author

Okay