File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -143,21 +143,21 @@ export function getSortedPluginsByHook<K extends keyof Plugin>(
143143 const sortedPlugins : Plugin [ ] = [ ]
144144 // Use indexes to track and insert the ordered plugins directly in the
145145 // resulting array to avoid creating 3 extra temporary arrays per hook
146- const pre = 0 ;
147- let normal = 0 ;
148- // post = 0
146+ let pre = 0 ,
147+ normal = 0 ,
148+ post = 0
149149 for ( const plugin of plugins ) {
150150 const hook = plugin [ hookName ]
151151 if ( hook ) {
152152 if ( typeof hook === 'object' ) {
153- // if (hook.order === 'pre') {
154- // sortedPlugins.splice(pre++, 0, plugin)
155- // continue
156- // }
157- // if (hook.order === 'post') {
158- // sortedPlugins.splice(pre + normal + post++, 0, plugin)
159- // continue
160- // }
153+ if ( hook . order === 'pre' ) {
154+ sortedPlugins . splice ( pre ++ , 0 , plugin )
155+ continue
156+ }
157+ if ( hook . order === 'post' ) {
158+ sortedPlugins . splice ( pre + normal + post ++ , 0 , plugin )
159+ continue
160+ }
161161 }
162162 sortedPlugins . splice ( pre + normal ++ , 0 , plugin )
163163 }
You can’t perform that action at this time.
0 commit comments