I'm in a situation where it would be advantageous to parse some files into JS to scaffold and automate some stuff.I've considered writing a Webpack loader, but I'd prefer to avoid using Webpack for this project. Although, I'm ready do that if it's the best way.I've looked into hacking require.extensions but it has been deprecated. The docs say:Deprecated. In the past, this list has been used to load non-JavaScript modules into Node.js by compiling them on-demand. However, in practice, there are much better ways to do this, such as loading modules via some other Node.js program, or compiling them to JavaScript ahead of time.I've also considered just writing a parser that will run before starting the app or when a file change triggers nodemon.What do you think /r/node ?
Submitted August 14, 2020 at 04:57AM by pepitoooooooo
No comments:
Post a Comment