Skip to content

Instantly share code, notes, and snippets.

@kenwheeler
Created April 11, 2017 00:10
Show Gist options
  • Save kenwheeler/330c863e76cab851745e3a354fe63a6a to your computer and use it in GitHub Desktop.
Save kenwheeler/330c863e76cab851745e3a354fe63a6a to your computer and use it in GitHub Desktop.
var player = require('play-sound')((opts = {}));
var path = require('path');
function JeopardyPlugin(options) {}
JeopardyPlugin.prototype.apply = function(compiler) {
var audio;
compiler.plugin('compile', function() {
var build = path.join(process.cwd(), '/configuration/webpack/jeopardy.mp3');
audio = player.play(build);
});
compiler.plugin('done', function() {
audio.kill();
var end = path.join(process.cwd(), '/configuration/webpack/end.mp3');
audio = player.play(end);
});
};
module.exports = JeopardyPlugin;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment