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
{{ message }}
This repository was archived by the owner on Sep 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 7, 2026. It is now read-only.
Allow from to be array of paths / glob, respect order #631
Please allow the from property to contain an array of paths / glob patterns
because I need to include files from several different locations and copy them all into one folder.
This is quite ugly and verbose doing it with glob.
The assets array in transformAll should then be returned in the order of the from array so you can rely on javascript execution order.
Feature Use Case
Copying and or concatenating and transforming (javascript) files from multiple locations into one file / folder.
Please paste the results of npx webpack-cli info here, and mention other relevant information
Respecting order is very bad for perf, work is going on on different cores, please sort them inside transformAll as you want, sorry, we don't want to implement this
Activity
alexander-akait commentedon Oct 11, 2021
Respecting order is very bad for perf, work is going on on different cores, please sort them inside
transformAllas you want, sorry, we don't want to implement thisemkayy commentedon Oct 11, 2021
Hi, I don't see how this would affect performance. The array is already getting sorted (https://github.com/webpack-contrib/copy-webpack-plugin/blob/beff64eff0f070632d0e5f587b2afee766d3c1fa/src/index.js#L648)
Only the sorting logic would need te be changed so it does sort according to the input order.
alexander-akait commentedon Oct 11, 2021
Because this logic don't know nothing about of input order
emkayy commentedon Oct 11, 2021
Well, actually it does:
https://github.com/webpack-contrib/copy-webpack-plugin/blob/beff64eff0f070632d0e5f587b2afee766d3c1fa/src/index.js#L627
itemdoes contain thefromproperty and iffromis an array, the sort method has access to the input order.alexander-akait commentedon Oct 11, 2021
Try to implement this and PR welcome
emkayy commentedon Oct 12, 2021
I thought you are offering feature requests here?
alexander-akait commentedon Oct 12, 2021
I don't understand why you need order by patterns, your order already the same, what is point to do unnecessary calculations
emkayy commentedon Oct 12, 2021
This feature request basically consists of 2 parts:
1.
fromas an arraytransformAllmethod to keep the output in the same order as the input... which brings me to the 2nd part:
2. Ordering of the transformAll parameter
assetsalexander-akait commentedon Oct 12, 2021
Yes, we can do it, make sense, but why do not use blog base above and using
filterfunction, better DX?alexander-akait commentedon Oct 12, 2021
Anyway it is low priority, so PR welcome
feat: implement support for array values in `from` property. Closes w…
feat: allow from option to be an array of paths
feat: allow from option to be an array of paths
feat: allow from option to be an array of paths
feat: allow from option to be an array of paths
feat: allow from option to be an array of paths