Merge pull request #3477 from mattkrick/patch-1
turn transform into a simple `for` loop
This commit is contained in:
commit
27bd5c6719
@ -438,13 +438,14 @@ export default class File extends Store {
|
||||
transform(): BabelFileResult {
|
||||
// In the "pass per preset" mode, we have grouped passes.
|
||||
// Otherwise, there is only one plain pluginPasses array.
|
||||
this.pluginPasses.forEach((pluginPasses, index) => {
|
||||
for (let i = 0; i < this.pluginPasses.length; i++) {
|
||||
const pluginPasses = this.pluginPasses[i];
|
||||
this.call("pre", pluginPasses);
|
||||
this.log.debug("Start transform traverse");
|
||||
traverse(this.ast, traverse.visitors.merge(this.pluginVisitors[index], pluginPasses), this.scope);
|
||||
traverse(this.ast, traverse.visitors.merge(this.pluginVisitors[i], pluginPasses), this.scope);
|
||||
this.log.debug("End transform traverse");
|
||||
this.call("post", pluginPasses);
|
||||
});
|
||||
}
|
||||
|
||||
return this.generate();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user