@dcoder-x/plugin-shared 0.1.2 → 0.1.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.
@@ -98,7 +98,19 @@ class ComponentExtractor {
98
98
  const fallbackDeps = Array.isArray(mod?.dependencies) ? mod.dependencies : [];
99
99
  const out = [];
100
100
  for (const dep of fallbackDeps) {
101
- const depModule = dep?.module || dep?._module;
101
+ let depModule = null;
102
+ if (graph?.getModule) {
103
+ depModule = graph.getModule(dep);
104
+ }
105
+ // Legacy fallback for older webpack versions.
106
+ if (!depModule) {
107
+ try {
108
+ depModule = dep?.module || dep?._module;
109
+ }
110
+ catch {
111
+ depModule = null;
112
+ }
113
+ }
102
114
  const depPath = normalizeModulePath(depModule?.resource || depModule?.userRequest);
103
115
  if (depPath)
104
116
  out.push(depPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcoder-x/plugin-shared",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",