webpack-plugin-serve
Version:
A Development Server in a Webpack Plugin
26 lines (22 loc) • 756 B
JavaScript
/*
Copyright © 2018 Andrew Powell
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of this Source Code Form.
*/
const { error, info, warn } = console;
const log = {
error: error.bind(console, '⬡ wps:'),
info: info.bind(console, '⬡ wps:'),
refresh: 'Please refresh the page',
warn: warn.bind(console, '⬡ wps:')
};
const noop = () => {};
const silent = {
error: noop,
info: noop,
warn: noop
};
module.exports = () => (window.webpackPluginServe.silent ? silent : log);