Skip to content

Commit

Permalink
custom config file
Browse files Browse the repository at this point in the history
  • Loading branch information
nightmode committed Mar 12, 2020
1 parent 1a903f4 commit eed6b01
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
2 changes: 2 additions & 0 deletions docs/advanced/custom-config-file.md
Expand Up @@ -13,6 +13,8 @@ module.exports = function(feri) {

Now you can type `feri` and the custom config file will take of the rest. Even better, command line switches still take precedence. That means typing `feri --nowatch` will temporarily override the config file setting.

Custom config files can be created manually like in the example above but for an even better template, run `feri --init` to have a custom config file created for you.

Protip: Not just the [config](api/config.md#feri---config) but indeed all [API](docs/advanced/api/index.md#feri---api) features are available inside custom config files.

## License
Expand Down
12 changes: 6 additions & 6 deletions docs/advanced/unique-file-types.md
Expand Up @@ -15,9 +15,9 @@ To enable Brotli compressed versions of your destination files, add the followin

```js
// add br build tasks for the following extensions
let types = ['css', 'html', 'js']
for (const i in types) {
feri.config.map.sourceToDestTasks[types[i]].push('br')
const types = ['css', 'html', 'js', 'svg']
for (const type of types) {
feri.config.map.sourceToDestTasks[type].push('br')
}
```

Expand Down Expand Up @@ -99,9 +99,9 @@ To enable Gzip compressed versions of your destination files, add the following

```js
// add gz build tasks for the following extensions
let types = ['css', 'html', 'js']
for (const i in types) {
feri.config.map.sourceToDestTasks[types[i]].push('gz')
const types = ['css', 'html', 'js', 'svg']
for (const type of types) {
feri.config.map.sourceToDestTasks[type].push('gz')
}
```

Expand Down
56 changes: 35 additions & 21 deletions templates/custom-config.js
@@ -1,28 +1,42 @@
module.exports = function(feri) {
// uncomment anything you like
//---------
// Aliases
//---------
const { build, clean, config, functions, shared, watch } = feri

// languages
// feri.config.language = 'de-ch' // German (Switzerland)
// feri.config.language = 'de-de' // German (Germany)
// feri.config.language = 'en-us' // English (US)
// feri.config.language = 'fr-fr' // French (France)
// feri.config.language = 'it-ch' // Italian (Switzerland)
// feri.config.language = 'it-it' // Italian (Italy)
// feri.config.language = 'pt-br' // Portuguese (Brazil)
// feri.config.language = 'sv-se' // Swedish (Sweden)
//----------
// Language
//----------
// config.language = 'de-ch' // German (Switzerland)
// config.language = 'de-de' // German (Germany)
// config.language = 'en-us' // English (US)
// config.language = 'fr-fr' // French (France)
// config.language = 'it-ch' // Italian (Switzerland)
// config.language = 'it-it' // Italian (Italy)
// config.language = 'pt-br' // Portuguese (Brazil)
// config.language = 'sv-se' // Swedish (Sweden)

// options
// feri.config.option.clean = true
// feri.config.option.build = true
// feri.config.option.watch = true
// feri.config.option.extensions = true
//-----------------------------------------
// Create Brotli and Gzip Compressed Files
//-----------------------------------------
// for (const type of ['css', 'html', 'js', 'svg']) {
// config.map.sourceToDestTasks[type].push('br', 'gz')
// }

// paths
// feri.config.path.source = 'source'
// feri.config.path.dest = 'dest'
//---------
// Options
//---------
// config.option.clean = true
// config.option.build = true
// config.option.watch = true
// config.option.extensions = true

// source maps
// feri.config.sourceMaps = true
//-------
// Paths
//-------
// config.path.source = 'source'
// config.path.dest = 'dest'

// for even more options visit https://github.com/nightmode/feri/blob/master/docs/advanced/api/config.md
// Looking for even more options?
// https://github.com/nightmode/feri/blob/master/docs/advanced/api/config.md
}

0 comments on commit eed6b01

Please sign in to comment.