Which grunt module was used to combine these files?

31 Views Asked by At

I found an old project which was using grunt to build and minify many JS files. The JS files, along with the code, have these '@include' annotations which signals which JS files should be included there, e.g:

//@include include/_extend-namespace.js
//@include lib/_modernizr.js
//@include include/_init-media-query.js
//@include controllers/_signup.js

var forcePinToTop = false;
var enableScrollButtonMovement = false;
var pTopVal;
var pLeftVal;
...

Can you help me identify which module was used for this purpose?

All modules I found use configuration to specify how to combine files, but it's not the case here where you only specify the top JS file.

2

There are 2 best solutions below

3
Cristóbal Díaz Álvarez On BEST ANSWER

Maybe this one?: https://www.npmjs.com/package/grunt-preprocess

Very hard to know...

Best way is to look to package.json or grunt configuration files

2
Zac Anger On

Looks like grunt-preprocess, which is a wrapper over preprocess. The code that actually does the including is here. Assuming no other conflicting config, you should be able to change those to require or import with a little bit of sed/vim/regex find and replace.