我有一个关于主题部署的问题。
bower和wiredep模块工作得很好,我通过这种方式添加了很多内容!但是,现在我必须合并这些文件,例如bundle.js、bundle.css等... grunt-usemin 模块非常适合此目的,但我找不到Drupal 主题信息文件的集成(请参阅: https: //www.drupal.org/node/171205)下面你可以看到一个示例文件:
主题名称.info:
name = Theme
description = Tableless, recolorable, multi-column, fluid width theme (default).
version = 1.0
core = 7.x
;bower:css
stylesheets[all][] = src/components/module1/style1.css
stylesheets[all][] = src/components/module2/style2.css
;endbower
;bower:js
scripts[] = src/components/module/dist/vendor.js
scripts[] = src/components/module2/dist/script.js
;endbower
咕噜连线任务:
wiredep: {
task: {
src: ['theme_name.info'],
options: {
fileTypes: {
info: {
block: /(([ \t]*);\s*bower:*(\S*))(\n|\r|.)*?(;\s*endbower)/gi,
detect: {
js: /scripts\[\] = \s(.+js)/gi,
css: /stylesheets\[all\]\[\] = \s(.+css)/gi
},
replace: {
js: 'scripts[] = {{filePath}}',
css: 'stylesheets[all][] = {{filePath}}'
}
}
}
}
}
}
好吧,我需要自定义信息文件的grunt-usemin任务......在这方面等待您的帮助。
谢谢你。