Friday, 24 July 2020

Is using ES6 modules in a node backend bad practice?

Hi! I’m currently building a multiplayer web game where my frontend consists of ES6 modules bundled with Webpack. I plan to use node for the backend.I’m thinking that I‘m going to have the server reuse some of the modules that are used on the frontend. The problem, however, is that Node doesn’t support ES6 imports!First of all, is it bad practice to make the server reuse client-side code? I thought it would be nice if the app was “isomorphic” so that I don’t have to rewrite code for my server’s copy of the game. But something doesn’t quite feel right about what I’m doing.Second of all, is it uncomventional/bad to also use Webpack+babel to bundle my backend? (so that I can use ES6 imports in my server?)

Submitted July 24, 2020 at 09:10AM by santoso-sheep

No comments:

Post a Comment