Skip to content

Commit 2c2f92e

Browse files
committed
fix(@web/rollup-plugin-import-meta-assets): consistent order of switch cases
1 parent 1ea4af2 commit 2c2f92e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/good-rockets-reflect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@web/rollup-plugin-import-meta-assets': patch
3+
---
4+
5+
sort glob to ensure the order of switch cases and consistent build output for same files

packages/rollup-plugin-import-meta-assets/src/rollup-plugin-import-meta-assets.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ function importMetaAssets({ include, exclude, warnOnError, transform } = {}) {
105105
const { globby } = await import('globby');
106106
// execute the glob
107107
const result = await globby(glob, { cwd: path.dirname(id) });
108-
const paths = result.map(r =>
109-
r.startsWith('./') || r.startsWith('../') ? r : `./${r}`,
110-
);
108+
const paths = result
109+
.sort()
110+
.map(r => (r.startsWith('./') || r.startsWith('../') ? r : `./${r}`));
111111

112112
// create magic string if it wasn't created already
113113
ms = ms || new MagicString(code);

0 commit comments

Comments
 (0)