plopjs/plop

Append unique with '*' character

開放

#275 建立於 2021年7月21日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (266 個分叉)batch import
buggood first issue

倉庫指標

星標
 (6,845 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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.

貢獻者指南