You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev-guide/plugin-dev.md
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,30 @@ export default {
235
235
<%# END_REPLACE %>
236
236
```
237
237
238
+
#### Filename edge cases
239
+
240
+
If you want to render a template file that either begins with a dot (i.e. `.env`) you will have to follow a specific naming convention, since dotfiles are ignored when publishing your plugin to npm:
241
+
```
242
+
# dotfile templates have to use an underscore instead of the dot:
243
+
244
+
/generator/template/_env
245
+
246
+
# When calling api.render('./template'), this will be rendered in the project folder as:
247
+
248
+
.env
249
+
```
250
+
Consequently, this means that you also have to follow a special naming convention if you want to render file whose name actually begins with an underscore:
251
+
```
252
+
# such templates have to use two underscores instead of the dot:
253
+
254
+
/generator/template/__variables.scss
255
+
256
+
# When calling api.render('./template'), this will be rendered in the project folder as:
0 commit comments