Skip to content

Commit

Permalink
apply #514 to v1 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Nov 25, 2023
1 parent 0e49d08 commit 7ddd19f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Any BREAKING CHANGE between minor versions will be documented here in upper case
- Favicon: Better error if the source file is missing [#504].
- Esbuild: Fix npm specifiers in the import map.
- Esbuild: Fix subextension support (ex: `.client.jsx`).
- A bug in fixPluginOrder that duplicated plugins in the config file [#514].
- Updated deps: `std`, `deno-dom`, `esbuild`, `vento`, `xml`, `terser`, `lightningcss`, `pagefind`, `preact`, `pug`, `svgo`.

## [1.19.3] - 2023-10-29
Expand Down Expand Up @@ -2477,6 +2478,7 @@ The first version.
[#496]: https://github.com/lumeland/lume/issues/496
[#502]: https://github.com/lumeland/lume/issues/502
[#504]: https://github.com/lumeland/lume/issues/504
[#514]: https://github.com/lumeland/lume/issues/514
[1.19.4]: https://github.com/lumeland/lume/compare/v1.19.3...HEAD
[1.19.3]: https://github.com/lumeland/lume/compare/v1.19.2...v1.19.3
Expand Down
10 changes: 7 additions & 3 deletions init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,14 @@ function fixPluginOrder(plugins: string[], plugin1: string, plugin2: string) {
const pos1 = plugins.indexOf(plugin1);
const pos2 = plugins.indexOf(plugin2);

if (pos2 !== -1) {
plugins.splice(pos2, 1);
if (pos2 === -1) {
plugins.splice(pos1 + 1, 0, plugin2);
return;
}

plugins.splice(pos1, 1, plugin1, plugin2);
if (pos1 > pos2) {
plugins[pos2] = plugin1;
plugins[pos1] = plugin2;
}
}
}

0 comments on commit 7ddd19f

Please sign in to comment.