UNPKG

1.5 kBJavaScriptView Raw
1var effectHash = {
2 "component-stylus-plugin":{
3 ext:{
4 styles:[".styl"]
5 }
6 },
7 "component-jade":{
8 ext:{
9 templates:[".jade"]
10 }
11 },
12 "component-coffee":{
13 ext:{
14 scripts:[".coffee"]
15 }
16 },
17 "component-sass":{
18 ext:{
19 styles:[".scss"]
20 }
21 },
22 "component-builder-handlebars":{
23 ext:{
24 templates:[".hbs"]
25 },
26 run: function(plugin, builder){
27 builder.use(plugin());
28 }
29 },
30 "component-hogan":{
31 ext:{
32 templates:[".stache",".mustache"]
33 }
34 },
35 "component-sass":{
36 ext:{
37 styles:[".scss"]
38 }
39 },
40 "component-json":{
41 ext:{
42 files:[".json"]
43 }
44 },
45 "component-roole":{
46 ext:{
47 styles:[".roo"]
48 }
49 },
50 "component-less":{
51 ext:{
52 styles:[".less"]
53 }
54 },
55 "component-markdown":{
56 ext:{
57 templates:[".md",".markdown"]
58 },
59 run: function(plugin, builder){
60 builder.use(plugin());
61 }
62 },
63 "component-html":{
64 ext:{
65 templates:[".html"]
66 }
67 }
68}
69function matchModules(config, plugins){
70 plugins.forEach(function(plugin){
71 if(effectHash[plugin]){
72 for(var type in effectHash[plugin].ext){
73 if(!config.src[type]) config.src[type] = [];
74 effectHash[plugin].ext[type].forEach(function(ext){
75 config.src[type].unshift(config.targetBase + '{/!(node_modules|dist|components)/**/*' + ext + ',/*' + ext + '}');
76 })
77 }
78 }
79 });
80}
81matchModules.config = effectHash;
82module.exports = matchModules;
83