V
V
Vyach Gor2018-07-30 18:50:37
gulp.js
Vyach Gor, 2018-07-30 18:50:37

How to correctly sort by prefix at the beginning of the file name?

There is a task in your gulp template to sort pictures depending on the prefix. For example, within the same folder there is a picture img.png and w-img.png and it is necessary that img.png be transferred to one folder during assembly, and w-img.png to another. So far, I've done what would work when the prefix at the end is like this "*+(-w).+*"

img: ['src/assets/img/**/*.+(jpg|jpeg|png|svg|gif|ico|JPG|JPEG|PNG|SVG|GIF|ICO)',
'!src/assets/img/**/*+(-w).+(jpg|jpeg|png|svg|gif|ico|JPG|JPEG|PNG|SVG|GIF|ICO)',],
imgTrash: ['src/assets/img/**/*+(-w).+(jpg|jpeg|png|svg|gif|ico|JPG|JPEG|PNG|SVG|GIF|ICO)'],

but if you remake the construction with the prefix "(w-)+* .+*" at the beginning, then the sorting does not work.
like this doesn't work
img: ['src/assets/img/**/*.+(jpg|jpeg|png|svg|gif|ico|JPG|JPEG|PNG|SVG|GIF|ICO)',
'!src/assets/img/**/(w-)+*.+(jpg|jpeg|png|svg|gif|ico|JPG|JPEG|PNG|SVG|GIF|ICO)',],
imgTrash: ['src/assets/img/**/(w-)+*.+(jpg|jpeg|png|svg|gif|ico|JPG|JPEG|PNG|SVG|GIF|ICO)'],

How to correctly sort by prefix at the beginning of the file name?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question