Reputation: 372
I started seeing:
(node:6420) Warning: require() of ES modules is not supported.
when starting my webpack build and was wondering if using all import export for webpack.config.js
was supported yet.
edit 1: I want to know if it's supported without using @babel/register or other transforms
Upvotes: 2
Views: 1649
Reputation: 29
If your code runs in Node, you can use the fs
package to interact with the file system
Upvotes: 0
Reputation: 6589
Is is supported in Node 13. You can use either the .mjs extension (for files where you need to use import/export), or set "type": "module" in your package.json.
Upvotes: 1