Skip to content

Include in destination file between 2 tags #38

@honkskillet

Description

@honkskillet

Let's say we have a target .js file with the tags

 /* injector:tag */
     //Maybe, nor maybe not some content
   /* endinjector */

Is there a way to use regex to inject in between these tags. If there is already content between the tags, I would like to overwrite the content. I don't want the tags overwritten though.

I have tried

   includes:{
      myIncludes: {
        options: {
          includeRegexp: /\/* injector:tag *\/[\s\S]*?\/* endinjector *\//,
        },
        files: [{
          src: '.tmp/soundTree.json',
          dest: '<%= yeoman.client %>/treeTarget.js',
        }],
      },
    },

But the entire target file gets over written by the source file. Any thoughts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions