-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathconfig.php
283 lines (242 loc) · 9.79 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<?php
return array(
/*
|--------------------------------------------------------------------------
| Collections
|--------------------------------------------------------------------------
|
| Basset is built around collections. A collection contains assets for
| your application. Collections can contain both stylesheets and
| javascripts.
|
| A default "application" collection is ready for immediate use. It makes
| a couple of assumptions about your directory structure.
|
| /public
| /assets
| /stylesheets
| /less
| /sass
| /javascripts
| /coffeescripts
|
| You can overwrite this collection or remove it by publishing the config.
|
*/
'collections' => array(
'application' => function($collection)
{
// Switch to the stylesheets directory and require the "less" and "sass" directories.
// These directories both have a filter applied to them so that the built
// collection will contain valid CSS.
$directory = $collection->directory('assets/stylesheets', function($collection)
{
$collection->requireDirectory('less')->apply('Less');
$collection->requireDirectory('sass')->apply('Sass');
$collection->requireDirectory();
});
$directory->apply('CssMin');
$directory->apply('UriRewriteFilter');
// Switch to the javascripts directory and require the "coffeescript" directory. As
// with the above directories we'll apply the CoffeeScript filter to the directory
// so the built collection contains valid JS.
$directory = $collection->directory('assets/javascripts', function($collection)
{
$collection->requireDirectory('coffeescripts')->apply('CoffeeScript');
$collection->requireDirectory();
});
$directory->apply('JsMin');
}
),
/*
|--------------------------------------------------------------------------
| Production Environment
|--------------------------------------------------------------------------
|
| Basset needs to know what your production environment is so that it can
| respond with the correct assets. When in production Basset will attempt
| to return any built collections. If a collection has not been built
| Basset will dynamically route to each asset in the collection and apply
| the filters.
|
| The last method can be very taxing so it's highly recommended that
| collections are built when deploying to a production environment.
|
| You can supply an array of production environment names if you need to.
|
*/
'production' => array('production', 'prod'),
/*
|--------------------------------------------------------------------------
| Build Path
|--------------------------------------------------------------------------
|
| When assets are built with Artisan they will be stored within a directory
| relative to the public directory.
|
| If the directory does not exist Basset will attempt to create it.
|
*/
'build_path' => 'builds',
/*
|--------------------------------------------------------------------------
| Open Base Dir Restrictions
|--------------------------------------------------------------------------
|
| Some hosts run with open base directory restrictions which prevents certain
| PHP functions from working. Basset relies on Curl's CURLOPT_FOLLOWLOCATION
| to follow location headers when assets don't have recognizable extensions.
| This configuration option lets the developer disable the code that implements
| this known restriction.
|
| Note: that disabling this option could cause redirects on remote assets to
| not be loaded correctly.
|
*/
'follow_location' => true,
/*
|--------------------------------------------------------------------------
| Debug
|--------------------------------------------------------------------------
|
| Enable debugging to have potential errors or problems encountered
| during operation logged to a rotating file setup.
|
*/
'debug' => false,
/*
|--------------------------------------------------------------------------
| Node Paths
|--------------------------------------------------------------------------
|
| Many filters use Node to build assets. We recommend you install your
| Node modules locally at the root of your application, however you can
| specify additional paths to your modules.
|
*/
'node_paths' => array(
base_path().'/node_modules'
),
/*
|--------------------------------------------------------------------------
| Gzip Built Collections
|--------------------------------------------------------------------------
|
| To get the most speed and compression out of Basset you can enable Gzip
| for every collection that is built via the command line. This is applied
| to both collection builds and development builds.
|
| You can use the --gzip switch for on-the-fly Gzipping of collections.
|
*/
'gzip' => false,
/*
|--------------------------------------------------------------------------
| Asset and Filter Aliases
|--------------------------------------------------------------------------
|
| You can define aliases for commonly used assets or filters.
| An example of an asset alias:
|
| 'layout' => 'stylesheets/layout/master.css'
|
| Filter aliases are slightly different. You can define a simple alias
| similar to an asset alias.
|
| 'YuiCss' => 'Yui\CssCompressorFilter'
|
| However if you want to pass in options to an aliased filter then define
| the alias as a nested array. The key should be the filter and the value
| should be a callback closure where you can set parameters for a filters
| constructor, etc.
|
| 'YuiCss' => array('Yui\CssCompressorFilter', function($filter)
| {
| $filter->setArguments('path/to/jar');
| })
|
|
*/
'aliases' => array(
'assets' => array(),
'filters' => array(
/*
|--------------------------------------------------------------------------
| Less Filter Alias
|--------------------------------------------------------------------------
|
| Filter is applied only when asset has a ".less" extension and it will
| attempt to find missing constructor arguments.
|
*/
'Less' => array('LessFilter', function($filter)
{
$filter->whenAssetIs('.*\.less')->findMissingConstructorArgs();
}),
/*
|--------------------------------------------------------------------------
| Sass Filter Alias
|--------------------------------------------------------------------------
|
| Filter is applied only when asset has a ".sass" or ".scss" extension and
| it will attempt to find missing constructor arguments.
|
*/
'Sass' => array('Sass\ScssFilter', function($filter)
{
$filter->whenAssetIs('.*\.(sass|scss)')->findMissingConstructorArgs();
}),
/*
|--------------------------------------------------------------------------
| CoffeeScript Filter Alias
|--------------------------------------------------------------------------
|
| Filter is applied only when asset has a ".coffee" extension and it will
| attempt to find missing constructor arguments.
|
*/
'CoffeeScript' => array('CoffeeScriptFilter', function($filter)
{
$filter->whenAssetIs('.*\.coffee')->findMissingConstructorArgs();
}),
/*
|--------------------------------------------------------------------------
| CssMin Filter Alias
|--------------------------------------------------------------------------
|
| Filter is applied only when within the production environment and when
| the "CssMin" class exists.
|
*/
'CssMin' => array('CssMinFilter', function($filter)
{
$filter->whenAssetIsStylesheet()->whenProductionBuild()->whenClassExists('CssMin');
}),
/*
|--------------------------------------------------------------------------
| JsMin Filter Alias
|--------------------------------------------------------------------------
|
| Filter is applied only when within the production environment and when
| the "JsMin" class exists.
|
*/
'JsMin' => array('JSMinFilter', function($filter)
{
$filter->whenAssetIsJavascript()->whenProductionBuild()->whenClassExists('JSMin');
}),
/*
|--------------------------------------------------------------------------
| UriRewrite Filter Alias
|--------------------------------------------------------------------------
|
| Filter gets a default argument of the path to the public directory.
|
*/
'UriRewriteFilter' => array('UriRewriteFilter', function($filter)
{
$filter->setArguments(public_path())->whenAssetIsStylesheet();
})
)
)
);