哪个grunt模块被用来合并这些文件?

huangapple go评论47阅读模式
英文:

Which grunt module was used to combine these files?

问题

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.

英文:

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.

答案1

得分: 0

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

英文:

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

得分: 0

看起来是grunt-preprocess,它是preprocess的封装。实际执行包含操作的代码在这里。假设没有其他冲突的配置,你应该能够使用一些sed/vim/正则查找替换,将它们改为requireimport

英文:

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.

huangapple
  • 本文由 发表于 2023年5月13日 13:25:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76241213.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定