File tree 1 file changed +11
-11
lines changed
packages/vite/src/node/plugins
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>(
143
143
const sortedPlugins : Plugin [ ] = [ ]
144
144
// Use indexes to track and insert the ordered plugins directly in the
145
145
// 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
149
149
for ( const plugin of plugins ) {
150
150
const hook = plugin [ hookName ]
151
151
if ( hook ) {
152
152
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
+ }
161
161
}
162
162
sortedPlugins . splice ( pre + normal ++ , 0 , plugin )
163
163
}
You can’t perform that action at this time.
0 commit comments