代码拉取完成,页面将自动刷新
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.warmup = exports.pitch = undefined;
var _loaderUtils = require('loader-utils');
var _loaderUtils2 = _interopRequireDefault(_loaderUtils);
var _workerPools = require('./workerPools');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function pitch() {
const options = _loaderUtils2.default.getOptions(this) || {};
const workerPool = (0, _workerPools.getPool)(options);
if (!workerPool.isAbleToRun()) {
return;
}
const callback = this.async();
workerPool.run({
loaders: this.loaders.slice(this.loaderIndex + 1).map(l => {
return {
loader: l.path,
options: l.options,
ident: l.ident
};
}),
resource: this.resourcePath + (this.resourceQuery || ''),
sourceMap: this.sourceMap,
emitError: this.emitError,
emitWarning: this.emitWarning,
resolve: this.resolve,
target: this.target,
minimize: this.minimize,
resourceQuery: this.resourceQuery,
optionsContext: this.rootContext || this.options.context
}, (err, r) => {
if (r) {
r.fileDependencies.forEach(d => this.addDependency(d));
r.contextDependencies.forEach(d => this.addContextDependency(d));
}
if (err) {
callback(err);
return;
}
callback(null, ...r.result);
});
}
function warmup(options, requires) {
const workerPool = (0, _workerPools.getPool)(options);
workerPool.warmup(requires);
}
exports.pitch = pitch;
exports.warmup = warmup; // eslint-disable-line import/prefer-default-export
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。