2016-09-20 2 views
0

Ich verwende Webpack Shell Plugin, um Skripts auszuführen, nachdem der Webpack-Build abgeschlossen wurde."Möglicher EventEmitter-Speicherverlust erkannt" bei Verwendung des Webpack-Shell-Plugins

Allerdings, wenn ich Webpack laufen bekomme ich diese Warnungen:

(node:91967) Warning: Possible EventEmitter memory leak detected. 11 unpipe listeners added. Use emitter.setMaxListeners() to increase limit 
(node:91967) Warning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit 
(node:91967) Warning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit 
(node:91967) Warning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit 
Running onBuildExit 

Das ist mein Plugin-Konfiguration:

config.plugins.push(new WebpackShellPlugin({ 
    onBuildExit: [ 
     "echo 'Running onBuildExit'", 
     "cp file1.js dist/file1.js", 
     "cp file2.js dist/file2.js", 
     "cp file3.js dist/file3.js", 
     "cp file4.js dist/file4.js", 
     "cp file5.js dist/file5.js", 
    ] 
})) 

Was ist die Ursache für diese Warnungen und wie kann ich sie lösen?

Antwort

0

Dies ist nicht die Ursache, aber die Lösung für mich bestand darin, die einzelnen Befehle in ein längeres Skript zusammenzuführen.

config.plugins.push(new WebpackShellPlugin({ 
    onBuildExit: [ 
     ` 
     echo 'Running onBuildExit' 
     cp file1.js dist/file1.js 
     cp file2.js dist/file2.js 
     cp file3.js dist/file3.js 
     cp file4.js dist/file4.js 
     cp file5.js dist/file5.js 
     ` 
    ] 
})) 
Verwandte Themen