Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to overwrite only one template #1771

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

A-312
Copy link

@A-312 A-312 commented May 2, 2020

env.conf.templates.overwrite can be a string (module name or script filepath, should return a function) or an Object, key is the original filepath and value is the overwriter filepath (= will be loaded instead original)

e.g.:

{
  "...": "...",
  "templates": {
    "overwrite": {
      "node_modules/docdash/tmpl/params.tmpl": "docs/home/tmpl/params.tmpl"
    }
  }
}

When env.conf.templates.overwrite != false: cached file will print: 'load ${filepath}' / 'load ${overwrite} instead ${filepath}'

Q A
Bug fix? no
New feature? yes
Breaking change? no
Deprecations? no
Tests added? yes/no

env.conf.templates.overwrite can be a string (module name or script filepath, should return a function) or an Object, key is the original filepath and value is the overwriter filepath (= will be loaded instead original)

e.g.:

```json
{
  "...": "...",
  "templates": {
    "overwrite": {
      "node_modules/docdash/tmpl/params.tmpl": "docs/home/tmpl/params.tmpl"
    }
  }
}
```

When env.conf.templates.overwrite != false: cached file will print: 'load ${filepath}' / 'load ${overwrite} instead ${filepath}'
@A-312 A-312 marked this pull request as ready for review May 2, 2020 10:20
@A-312
Copy link
Author

A-312 commented May 2, 2020

Where is the test for partial function ? I didn't find anyhing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant