At the moment all my module in my nodejs server are imported as require() ie:
let path = require(\'path\');
let express = require(\'express\');
let http = re
It works in the webpack situation because the code is run through babel. You can run your node.js code through babel.
Install the babel cli if you don't have it
npm install --save-dev babel-cli
Then run your code like this:
./node_modules/.bin/babel-node server.js
Or put it in package.json.
{
"scripts": {
"start": "babel-node server.js"
}
}