Skip to content

Commit

Permalink
Merge pull request #468 from preactjs/plugin-order-2
Browse files Browse the repository at this point in the history
Fix wrong plugin ordering
  • Loading branch information
marvinhagemeister authored Mar 27, 2021
2 parents 8e169bd + fc5cf31 commit 17bf635
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-grapes-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'wmr': patch
---

Fix incorrect plugin ordering introduced in #465 (unreleased)
2 changes: 1 addition & 1 deletion packages/wmr/src/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export async function bundleProd({
});

// Plugins are pre-sorted
const split = plugins.findIndex(p => p.enforce !== 'post');
const split = plugins.findIndex(p => p.enforce === 'post');

const bundle = await rollup.rollup({
input,
Expand Down
2 changes: 1 addition & 1 deletion packages/wmr/src/wmr-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function wmrMiddleware({
root = root || cwd;

// Plugins are pre-sorted
const split = plugins.findIndex(p => p.enforce !== 'post');
const split = plugins.findIndex(p => p.enforce === 'post');
const NonRollup = createPluginContainer(
[
...plugins.slice(0, split),
Expand Down

0 comments on commit 17bf635

Please sign in to comment.