fix: Make importing styles not break the builds

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2023-04-14 07:41:56 +03:00
1 parent 1e0cb9fc14
commit e5f7d58719
1 file changed
+9 -6
@@ -16,14 +16,17 @@ class ProtectFromImportingNonDependencies {
const isDependencyOfDependency =
toBeResolved.context.includes("node_modules");
if (!isLocalDependency && !isDependencyOfDependency) {
const dependencyName = getDependencyName(toBeResolved.request);
nodeModulesToBeResolved.add(dependencyName);
}
});
});
const dependencyWeAreInterested =
!isLocalDependency && !isDependencyOfDependency && dependencyName;
if (dependencyWeAreInterested) {
nodeModulesToBeResolved.add(dependencyName);
}
});
}
);
compiler.hooks.afterCompile.tap("compile", () => {
const notSpecifiedDependencies = [...nodeModulesToBeResolved].filter(