0

I would like to write a JavaScript library using ES6 modules to manage submodules. I would also like to be able to use it in both front-end applications (with babel and webpack) and NodeJS back-end projects.

Is there a way to "build" the library, written with ES6 modules, in order to use it also as a NodeJS library?

2 Answers2

0

I believe this question is related with Webpack for back-end?

But yes, it is possible. You just need to install babel and webpack and then you will be all set

Victor Oliveira
  • 1,109
  • 1
  • 12
  • 29
0

Yes! webpack supports both node and web targets! You can find more information about how to set this in your config at webpack.js.org/configuration/target

Sean Larkin
  • 6,290
  • 1
  • 28
  • 43