-
Notifications
You must be signed in to change notification settings - Fork 143
Recipes
Evan Lovely edited this page Feb 13, 2015
·
5 revisions
Share your wiredep configuration to support non-default filetypes.
Drupal Theme Files - @EvanLovely
drupal: {
block: /(([ \t]*);\s*bower:*(\S*))(\n|\r|.)*?(;\s*endbower)/gi,
detect: {
js: /<script.*src=['"]([^'"]+)/gi,
css: /<link.*href=['"]([^'"]+)/gi
},
replace: {
js: 'scripts[] = {{filePath}}',
css: 'stylesheets[] = {{filePath}}'
}
}
If you need to use wiredep to automatically inject Bower components into HAML files (before they are compiled into HTML), the config is pretty similar to Jade (which is usable out of the box):
fileTypes: {
haml: {
block: /(([ \t]*)\/\s*bower:*(\S*))(\n|\r|.)*?(\/\s*endbower)/gi,
detect: {
js: /%script{.*:src => ['"]([^'"]+)/gi,
css: /%link{.*:href => ['"]([^'"]+)/gi
},
replace: {
js: '%script{:src => \'{{filePath}}\'}',
css: '%link{:rel => \'stylesheet\', :href => \'{{filePath}}\'}\/'
}
}
}