Last active
August 29, 2015 14:09
-
-
Save sirlancelot/944888423c279f61c011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = AddCustomCodePlugin | |
function AddCustomCodePlugin() {} | |
AddCustomCodePlugin.prototype.apply = function(compiler) { | |
var self = this | |
compiler.plugin("compilation", function(compilation) { | |
compilation.mainTemplate.plugin("local-vars", self.localVars.bind(self))) | |
}) | |
} | |
AddCustomCodePlugin.prototype.localVars = function(source, chunk) { | |
return source + [ | |
"// Add your javascript code here.", | |
"console.log('inside webpack bootstrap');" | |
].join("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment