@wuchale/vite-plugin 0.14.3 → 0.14.4
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/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// $$ cd ../.. && npm run test
|
|
2
2
|
import { relative, resolve } from "node:path";
|
|
3
|
+
import { platform } from "node:process";
|
|
3
4
|
import { getConfig as getConfig, Logger, AdapterHandler } from "wuchale";
|
|
4
5
|
const pluginName = 'wuchale';
|
|
5
6
|
const virtualPrefix = `virtual:${pluginName}/`;
|
|
@@ -32,7 +33,11 @@ class Wuchale {
|
|
|
32
33
|
await handler.init(sharedState);
|
|
33
34
|
this.#adapters[key] = handler;
|
|
34
35
|
for (const path of Object.values(handler.loaderPath)) {
|
|
35
|
-
|
|
36
|
+
let loaderPath = resolve(path);
|
|
37
|
+
if (platform === 'win32') {
|
|
38
|
+
// seems vite does this for the importer field in the resolveId hook
|
|
39
|
+
loaderPath = loaderPath.replaceAll('\\', '/');
|
|
40
|
+
}
|
|
36
41
|
if (loaderPath in this.#adaptersByLoaderPath) {
|
|
37
42
|
const otherKey = this.#adaptersByLoaderPath[loaderPath].key;
|
|
38
43
|
if (otherKey === key) {
|
|
@@ -121,6 +126,7 @@ class Wuchale {
|
|
|
121
126
|
// loader proxy
|
|
122
127
|
const adapter = this.#adaptersByLoaderPath[importer];
|
|
123
128
|
if (adapter == null) {
|
|
129
|
+
console.log(Object.keys(this.#adaptersByLoaderPath), 'ee');
|
|
124
130
|
this.#log.error(`Adapter not found for filename: ${importer}`);
|
|
125
131
|
return;
|
|
126
132
|
}
|