英文:
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/正则查找替换,将它们改为require
或import
。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论