1 | ;
|
2 |
|
3 | const {render} = require('../util');
|
4 |
|
5 | module.exports = function (from, to, context, tplSettings, options) {
|
6 | context = context || {};
|
7 | tplSettings = tplSettings || {};
|
8 |
|
9 | this.copy(
|
10 | from,
|
11 | to,
|
12 | {
|
13 | processDestinationPath: path => path.replace(/.ejs$/, ''),
|
14 | ...options,
|
15 | process: function (contents, filename) {
|
16 | return render(contents, context, {
|
17 | // Setting filename by default allow including partials.
|
18 | filename: filename,
|
19 | ...tplSettings
|
20 | });
|
21 | }
|
22 | },
|
23 | context,
|
24 | tplSettings
|
25 | );
|
26 | };
|