Bram z
Bram z

Reputation: 725

How to concat javascripts imports with Node/Gulp

I'm looking for a way to concatenate imports or something alike from JavaScripts files which are being processed/minified by Gulp. This would allow for dynamically including/excluding plugins while not having to restart the gulp process.

Say Gulp is processing file xxx.js and that file got an import or something alike in it, i would like it to be inlined in xxx.js instead of ending up as an require('zzz.js')

Upvotes: 0

Views: 457

Answers (2)

Bram z
Bram z

Reputation: 725

I use Webpack nowadays which does everything I want

Upvotes: 1

Justus Krapp
Justus Krapp

Reputation: 1116

if you just want to incude/inline a file into another, try https://github.com/coderhaoxin/gulp-file-include works also for anytype of file so also .js files

Upvotes: 0

Related Questions