{"id":16439162,"url":"https://github.com/posva/sounds-webpack-plugin","last_synced_at":"2025-05-09T01:24:11.127Z","repository":{"id":47408924,"uuid":"131016076","full_name":"posva/sounds-webpack-plugin","owner":"posva","description":"🔊Notify or errors, warnings, etc with sounds","archived":false,"fork":false,"pushed_at":"2021-09-01T15:01:23.000Z","size":905,"stargazers_count":122,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T18:18:27.602Z","etag":null,"topics":["notification","plugin","sound","webpack"],"latest_commit_sha":null,"homepage":"https://twitter.com/posva/status/989189125810073602","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/funding.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"posva","patreon":"posva","custom":"https://www.paypal.me/posva"}},"created_at":"2018-04-25T14:07:20.000Z","updated_at":"2023-09-22T18:53:35.000Z","dependencies_parsed_at":"2022-08-23T20:10:43.273Z","dependency_job_id":null,"html_url":"https://github.com/posva/sounds-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fsounds-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fsounds-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fsounds-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posva%2Fsounds-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posva","download_url":"https://codeload.github.com/posva/sounds-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253172448,"owners_count":21865518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["notification","plugin","sound","webpack"],"created_at":"2024-10-11T09:08:17.209Z","updated_at":"2025-05-09T01:24:11.101Z","avatar_url":"https://github.com/posva.png","language":"JavaScript","funding_links":["https://github.com/sponsors/posva","https://patreon.com/posva","https://www.paypal.me/posva"],"categories":[],"sub_categories":[],"readme":"# Sounds Webpack Plugin [![Build Status](https://img.shields.io/circleci/project/posva/sounds-webpack-plugin/master.svg)](https://circleci.com/gh/posva/sounds-webpack-plugin) [![npm package](https://img.shields.io/npm/v/sounds-webpack-plugin.svg)](https://www.npmjs.com/package/sounds-webpack-plugin)\n\n\u003e Notify or errors, warnings, etc with sounds\n\n[Video](https://twitter.com/posva/status/989189125810073602)\n\n## Installation\n\n```sh\nnpm install sounds-webpack-plugin\n```\n\n## Usage\n\nBasic usage with defaults\n\n```js\n// webpack.config.js\nconst SoundsPlugin = require('sounds-webpack-plugin')\n\nmodule.exports = {\n  plugins: [new SoundsPlugin()],\n}\n```\n\nYou can provide custom sounds to be loaded:\n\n```js\n// webpack.config.js\nconst SoundsPlugin = require('sounds-webpack-plugin')\nconst path = require('path')\n\nmodule.exports = {\n  plugins: [\n    new SoundsPlugin({\n      sounds: {\n        customSound: path.join(__dirname, 'sounds/error.mp3'),\n        customWarning: path.join(__dirname, 'sounds/warn.mp3'),\n        customSuccess: path.join(__dirname, 'sounds/ok.mp3'),\n      },\n      notifications: {\n        // invalid is a webpack hook\n        // you can check all hooks at https://github.com/webpack/webpack/blob/master/lib/Compiler.js#L32\n        // 'customSound' is the key provided in sounds\n        invalid: 'customSound',\n        // you can provide a function to customize it further\n        done(stats) {\n          if (stats.hasErrors()) {\n            this.play('customSound')\n          } else if (stats.hasWarnings()) {\n            this.play('customWarning')\n          } else {\n            this.play('customSuccess')\n          }\n        },\n      },\n    }),\n  ],\n}\n```\n\nYou can provide 3 special values that are not webpack hooks: `$hasErrors`, `$hasWarnings`, `$success` and `$successAfterError`. You can check default values [here](https://github.com/posva/sounds-webpack-plugin/blob/master/src/index.js#L8). You can of course override any of them in `sounds` option.\n\nSoundsPlugin comes with 4 sounds:\n\n* `oof` - used for errors by default\n* `nope`:\n* `xpError`:\n* `levelUp`: - used when the build succeeds after an error\n\nSoundsPlugin uses [play-sound](https://github.com/shime/play-sound) under the hood. You can pass down options to the player with `playerOptions`:\n\n```js\n// webpack.config.js\nconst SoundsPlugin = require('sounds-webpack-plugin')\n\nmodule.exports = {\n  plugins: [\n    new SoundsPlugin({\n      playerOptions: {\n        // check https://github.com/shime/play-sound#options\n        // osx uses afplay\n      },\n    }),\n  ],\n}\n```\n\n## Related\n\n* [SoundNotificationWebpackPluginn](https://github.com/williamoliveira/sound-notification-webpack-plugin)\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposva%2Fsounds-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposva%2Fsounds-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposva%2Fsounds-webpack-plugin/lists"}