G
G
GreyCat95152020-10-01 13:14:06
Node.js
GreyCat9515, 2020-10-01 13:14:06

Nodejs App Compiler?

Are there now "compilers" with a plugin base that specialize in transforming nodejs code? From the options I found babel - but I'm not sure that this is the task of this library. Of the plugins, you need typescript, an obfuscator, an absolute path in imports ... The list can be replenished

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Robur, 2020-10-01
@GreyCat9515

babel is the "compiler" for js. with plugins and more. Not sure - read the documentation to understand if this is what you need or not. You can also take all sorts of bundlers. webpack, rollup.
Well, or specifically write what kind of "compiler" you need, what and into what it should compile.

G
GreyCat9515, 2020-10-01
@GreyCat9515

I will describe the task. I'm building a system of modules. Modules are in a separate directory. When a program starts, the kernel initializes all modules. The kernel does not know anything about modules in advance, resolving is done at runtime. As a result, when adding a new module to a directory, the kernel should normally detect it. Therefore, modules must be compiled separately from the kernel (one bundle per module + kernel bundle). Tried to configure webpack and rollup for this task - couldn't. I need to compile modules to expand the functionality of js. What do you see as ways to solve this problem?
UPD:
In principle, babel solves this problem. The doubt arises only because babel is positioned only as an es6 -> es5 transpiler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question