-
Notifications
You must be signed in to change notification settings - Fork 2
Config Structure
Junaid Atari edited this page Aug 23, 2016
·
5 revisions
The base structure of components/configs (config file) is described in the following section:
[
'component-id1' => [
'js' => [
'path/to/file1.js',
[
'@url(www.domain.com/)file2.js'
]
],
'css' => []
],
'component-id2' => [
'@src' => 'path/to',
// Component attributes (optional)
'@attributes' => [
'name' => 'value',
// ...
],
'js' => [
// Section attributes (optional)
'@attributes' => [
'name' => 'value',
// ...
],
'@baseUrl/file1.js',
[
'file2.js', '@id'=>'xyz', '@cdn' =>'//cdn-url.com/file-1x.min.js'
],
'@baseUrl/file3.js',
'@baseUrl/file4.js',
],
'css' => []
],
'component-id3' => [
'@baseUrl' => '/url3/to',
'css' => [
'to/file1.js',
'/to/file2.css',
[
'file3.css', '@cdn' =>'//cdn-url.com/file-x.x.min.css'
]
]
],
'component-id4' => [
'@src' => 'path4/to',
'@offline' => true,
'@offlineSections' => ['css'],
'@baseUrl' => '/url4/to',
'js' => [
'@thisComponentUrl/xyz.js',
'@thisSectionUrl/bundle.js',
['@baseUrl/file4-js1.js', '@id'=>'fixl'],
[
'file4-js2.js', '@offline' => true, '@id'=>'xyz', '@options'=>['x'=>'x'], '@cdn' =>'//cdn-url.com/file-4-js2.min.js',
// File attributes without starting with @ (optional)
'fooBar' => 'dummy'
],
'@baseUrl/file4-js3.js',
'@baseUrl/file4-js4.js',
],
'css' => [
'@componentUrl(component-id2)/to/file1.js',
'/to/file2.css',
[
'file3.css', '@id'=>'file3.css', '@cdn' =>'//cdn-url.com/to/file-x.x.min.css'
],
'@componentFile(component-id2/js/xyz)',
]
]
]There are two different ways of using component configuration:
- Add in
Cdn'scomponentproperty.
- Create a
cdn-configfile and paste in it.
Copyright (c) 2016 Junaid Atari and it's contributes.