1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 |
|
5 | var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
6 |
|
7 | require('v8-compile-cache');
|
8 |
|
9 | const Pipeline = require('./Pipeline');
|
10 |
|
11 | let pipeline;
|
12 |
|
13 | function 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 |
|
20 | function run(_x, _x2) {
|
21 | return _run.apply(this, arguments);
|
22 | }
|
23 |
|
24 | function _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 |
|
36 | exports.init = init;
|
37 | exports.run = run; |
\ | No newline at end of file |