Skip to content

Before & After not respecting dynamic names #277

@jaylinsell

Description

@jaylinsell

Assigning before injections so that you can dynamically place content in specific areas no longer works.
Used to be fine in hygen v5 - but on the latest projects with v6, it no longer works.

Example:

---
inject: true
to: src/assets/scss/styles.scss
before: additional <%= folder %>
---
@import '<%= folder %>/<%= h.changeCase.kebab(name) %>';

This would add the file to my styles.scss sheet, keeping it organised based on the type of folder chosen.
For example, a scss file added to ./components/_new-file.scss would appear in ./styles.scss just above the corresponding "//... additional <%= folder %> comment:

/* Variables
================================================== */
@import 'variables/colours';
@import 'variables/grid-variables';
@import 'variables/spacing';
@import 'variables/effects';
// ...additional variables

/* Components
============================= */
@import 'components/navigation';
@import 'components/footer';
@import 'components/header';
@import 'components/new-file';
// ...additional components

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions