code: function webpackGetCodeOnDone (compiler, done) {
  	if (!(compiler instanceof Compiler)) {
  		throw new Error(`Expected compiler to be an instance of 'Compiler'`)
  	}
  
  	const outputFs = compiler.outputFileSystem
  	const outputPath = compiler.outputPath
  
  	installSourceMapSupport(outputFs)
  
  	let compiledCode
  	let error = false
  
  	compiler.plugin('done', stats => {
  		error = false
  		// Server compilation errors need to be propagated to the client.
  		if (stats.compilation.errors.length) {
  			error = stats.compilation.errors[0]
  			return
  		}
  		const filename = getFilename(stats, outputPath, 'main')
  		const buffer = outputFs.readFileSync(filename)
  
  		try {
  			compiledCode = getCompiled(filename, buffer)
  		} catch (ex) {
  			error = ex
  		}
  
  		if (compiledCode) {
  			done(compiledCode)
  		} else {
  			throw new Error(
  				`webpack-get-code-on-done: Compiled code is 'undefined'. Please check latest changes that may produced this error. ${error}`
  			)
  		}
  	})
  }
docs: Returns compiled code after compilation (compiler "done")
  @param   {Compiler} compiler - e.g webpack([clientConfig, serverConfig])
  @param   {Function} done - callback to be executed with compiled server code