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
I have a file with multiple instances of the same placeholder text but only the first is transformed, chaining multiple instances fixes it but I wonder if it's possible to replace all instances in one run?
// file to copy + transform
<!DOCTYPE html><htmllang="en"><head></head><body><div>__EXT_VERSION__</div><!-- Without the chaining below, only this one is transformed --><div>__EXT_VERSION__</div><div>__EXT_VERSION__</div></body></html>
functionsetVersion(contents,filename){returncontents.toString()// You have to call this as many times as __EXT_VERSION__ appears in a file.replace('__EXT_VERSION__',pkg.version).replace('__EXT_VERSION__',pkg.version).replace('__EXT_VERSION__',pkg.version));}...copy({targets: [{src: "index.html",dest: "./",transform: setVersion},],}),
The text was updated successfully, but these errors were encountered:
jamestowers
changed the title
Transform only seems to work once per file
Transform only works on first instance of file
May 12, 2021
I have a file with multiple instances of the same placeholder text but only the first is transformed, chaining multiple instances fixes it but I wonder if it's possible to replace all instances in one run?
The text was updated successfully, but these errors were encountered: