UNPKG

867 BJavaScriptView Raw
1"use strict";
2
3var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
5var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
7require('v8-compile-cache');
8
9const Pipeline = require('./Pipeline');
10
11let pipeline;
12
13function init(options) {
14 pipeline = new Pipeline(options || {});
15 Object.assign(process.env, options.env || {});
16 process.env.HMR_PORT = options.hmrPort;
17 process.env.HMR_HOSTNAME = options.hmrHostname;
18}
19
20function run(_x, _x2) {
21 return _run.apply(this, arguments);
22}
23
24function _run() {
25 _run = (0, _asyncToGenerator2.default)(function* (path, isWarmUp) {
26 try {
27 return yield pipeline.process(path, isWarmUp);
28 } catch (e) {
29 e.fileName = path;
30 throw e;
31 }
32 });
33 return _run.apply(this, arguments);
34}
35
36exports.init = init;
37exports.run = run;
\No newline at end of file