build-firewall-plugin 0.0.1 → 0.0.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/build/index.js +3 -3
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -150,7 +150,6 @@ class BuildFirewallPlugin {
|
|
|
150
150
|
/**
|
|
151
151
|
* plugin logic
|
|
152
152
|
*/
|
|
153
|
-
const graph = compilation.moduleGraph;
|
|
154
153
|
for (const module of modules) {
|
|
155
154
|
const fromResource = module.nameForCondition();
|
|
156
155
|
if (!fromResource)
|
|
@@ -170,7 +169,8 @@ class BuildFirewallPlugin {
|
|
|
170
169
|
const toLayer = resolveLayer(toModuleResource, this.config.layers);
|
|
171
170
|
if (!toLayer)
|
|
172
171
|
continue;
|
|
173
|
-
|
|
172
|
+
const selfImport = fromLayer === toLayer && fromResource === toModuleResource;
|
|
173
|
+
if (selfImport) {
|
|
174
174
|
continue;
|
|
175
175
|
}
|
|
176
176
|
const rules = this.config.layers[fromLayer];
|
|
@@ -179,7 +179,7 @@ class BuildFirewallPlugin {
|
|
|
179
179
|
const isDenided = rules.deny.includes(toLayer);
|
|
180
180
|
const isAllowed = rules.allow.includes(toLayer);
|
|
181
181
|
if (isDenided || !isAllowed) {
|
|
182
|
-
|
|
182
|
+
console.log(`Dependency ${toModuleResource} is not allowed to import in ${fromResource}`);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
}
|