plopjs/plop

Append unique with '*' character

Open

#275 aperta il 21 lug 2021

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)JavaScript (266 fork)batch import
buggood first issue

Metriche repository

Star
 (6845 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I'm having trouble getting the append action to replace duplicate entries with the unique property in the following scenario:

// index.js template
/* PLOP_INJECT_EXPORT */
export * from './foo';
// plopfile.js action definition
ACTION: {
  type: 'append',
  data: {},
  path: indexFilePath,
  template: "export * from './foo';",
  pattern: '/* PLOP_INJECT_EXPORT */',
  unique: true,
}
// index.js file result
/* PLOP_INJECT_EXPORT */
export * from './foo';
export * from './foo';

Do you have any suggestions on how to get unique working in this situation?

This appears to be related to issue https://github.com/plopjs/plop/issues/174 which was closed.

Guida contributor