1 | var 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-lesser":{
|
56 | ext:{
|
57 | styles:[".less"]
|
58 | }
|
59 | },
|
60 | "component-markdown":{
|
61 | ext:{
|
62 | templates:[".md",".markdown"]
|
63 | },
|
64 | run: function(plugin, builder){
|
65 | builder.use(plugin());
|
66 | }
|
67 | },
|
68 | "component-html":{
|
69 | ext:{
|
70 | templates:[".html"]
|
71 | }
|
72 | }
|
73 | }
|
74 | function matchModules(config, plugins){
|
75 | plugins.forEach(function(plugin){
|
76 | if(effectHash[plugin]){
|
77 | for(var type in effectHash[plugin].ext){
|
78 | if(!config.src[type]) config.src[type] = [];
|
79 | effectHash[plugin].ext[type].forEach(function(ext){
|
80 | config.src[type].unshift(config.targetBase + '{/!(node_modules|dist|components)/**/*' + ext + ',/*' + ext + '}');
|
81 | })
|
82 | }
|
83 | }
|
84 | });
|
85 | }
|
86 | matchModules.config = effectHash;
|
87 | module.exports = matchModules;
|
88 |
|