@sveltejs/vite-plugin-svelte 4.0.0-next.2 → 4.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/utils/id.js +10 -4
package/package.json
CHANGED
package/src/utils/id.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createFilter, normalizePath } from 'vite';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
3
4
|
import { log } from './log.js';
|
|
4
5
|
import { DEFAULT_SVELTE_MODULE_EXT, DEFAULT_SVELTE_MODULE_INFIX } from './constants.js';
|
|
5
6
|
|
|
@@ -179,10 +180,15 @@ function buildFilter(include, exclude, extensions) {
|
|
|
179
180
|
*/
|
|
180
181
|
function buildModuleFilter(include, exclude, infixes, extensions) {
|
|
181
182
|
const rollupFilter = createFilter(include, exclude);
|
|
182
|
-
return (filename) =>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
return (filename) => {
|
|
184
|
+
const basename = path.basename(filename);
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
rollupFilter(filename) &&
|
|
188
|
+
infixes.some((infix) => basename.includes(infix)) &&
|
|
189
|
+
extensions.some((ext) => basename.endsWith(ext))
|
|
190
|
+
);
|
|
191
|
+
};
|
|
186
192
|
}
|
|
187
193
|
|
|
188
194
|
/**
|