/
eb
/
Surf
Обзор
Документация
Войти
/
eb
/
Surf
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/browser-sync/dist/public/init.js
33 строки
1 KB
EvgeniyBudaev
Initial commit
17 фев 2020, 09:02
17 фев 2020, 09:02
bb6f06f
Код
Авторство
О чём код?
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _ = require("../lodash.custom"); var cli_options_1 = require("../cli/cli-options"); /** * @param {BrowserSync} browserSync * @param {String} [name] - instance name * @param {Object} pjson * @returns {Function} */ module.exports = function (browserSync, name, pjson) { return function () { /** * Handle new + old signatures for init. */ var args = require("../args")(_.toArray(arguments)); /** * If the current instance is already running, just return an error */ if (browserSync.active) { return args.cb(new Error("Instance: " + name + " is already running!")); } // Env specific items args.config.version = pjson.version; args.config.cwd = args.config.cwd || process.cwd(); var _a = cli_options_1.merge(args.config), opts = _a[0], errors = _a[1]; if (errors.length) { return args.cb(new Error(cli_options_1.printErrors(errors))); } return browserSync.init(opts, args.cb); }; }; //# sourceMappingURL=init.js.map