anybar-webpack
Advanced tools
Comparing version
@@ -13,1 +13,7 @@ ## 1.0.6 | ||
- Show compilation error notification using `node-notifier` | ||
## 1.2.0 | ||
Changed: | ||
- Notifications are disabled by default. Enable by passing options object with field `enableNotifications: true`. |
@@ -10,15 +10,30 @@ var anyBarClient = require('./anybar-client'); | ||
var AnyBarWebpackPlugin = function (port, host) { | ||
var AnyBarWebpackPlugin = function (port, host, opts) { | ||
var self = this; | ||
var enableNotifications; | ||
opts = opts || {}; | ||
if (typeof port === 'object') { | ||
opts = port; | ||
port = undefined; | ||
} | ||
enableNotifications = opts.enableNotifications; | ||
var failBinded = fail.bind(this, port, host); | ||
this.fail = function(projectName, errorName) { | ||
failBinded(); | ||
notifier.notify({ | ||
title: 'Webpack Build Status', | ||
subtitle: 'Project: ' + projectName, | ||
message: errorName, | ||
icon: path.join(__dirname, 'icons/webpack-fail@2x.png') | ||
}); | ||
if (enableNotifications === true) { | ||
notifier.notify({ | ||
title: 'Webpack Build Status', | ||
subtitle: 'Project: ' + projectName, | ||
message: errorName, | ||
icon: path.join(__dirname, 'icons/webpack-fail@2x.png') | ||
}); | ||
} | ||
}; | ||
@@ -25,0 +40,0 @@ |
{ | ||
"name": "anybar-webpack", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Webpack build status plugin for menubar status indicator applications", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -21,2 +21,7 @@ [](http://badge.fury.io/js/anybar-webpack) | ||
## Known issues | ||
### No notifications when running from tmux | ||
Please, follow [this instructions](https://github.com/julienXX/terminal-notifier/issues/115#issuecomment-104214742). After that, update tmux config: `tmux source-file ~/.tmux.conf`. | ||
## Installation | ||
@@ -40,3 +45,5 @@ | ||
plugins: [ | ||
new AnyBarWebpackPlugin() | ||
new AnyBarWebpackPlugin({ | ||
enableNotifications: true | ||
}) | ||
] | ||
@@ -49,8 +56,8 @@ // ... | ||
### `new AnyBarWebpackPlugin([port [, host]])` | ||
### `new AnyBarWebpackPlugin([port][, host][, options])` | ||
All arguments are optional. If you want to pass the `host` argument, you need to pass a `port` first. | ||
### `port` | ||
Type: `Number` | ||
Default: `1738` | ||
- Type: `Number` | ||
- Default: `1738` | ||
@@ -60,5 +67,11 @@ The port the status bar application is running on. | ||
### `host` | ||
Type: `String` | ||
Default: `'127.0.0.1'` | ||
- Type: `String` | ||
- Default: `'127.0.0.1'` | ||
The host the status bar application is running on. | ||
### `enableNotifications` | ||
- Type: `Boolean` | ||
- Default: `false` | ||
Enable build errors desktop notifications. |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
51459
1.66%90
11.11%74
21.31%