forked from ionic-team/ionic-app-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocess.js
More file actions
29 lines (29 loc) Β· 1.03 KB
/
preprocess.js
File metadata and controls
29 lines (29 loc) Β· 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var logger_1 = require("./logger/logger");
var errors_1 = require("./util/errors");
var bundle_components_1 = require("./core/bundle-components");
function preprocess(context) {
var logger = new logger_1.Logger("preprocess");
return preprocessWorker(context).then(function () {
logger.finish();
})
.catch(function (err) {
var error = new errors_1.BuildError(err.message);
error.isFatal = true;
throw logger.fail(error);
});
}
exports.preprocess = preprocess;
function preprocessWorker(context) {
var bundlePromise = bundle_components_1.bundleCoreComponents(context);
return Promise.all([bundlePromise]);
}
function preprocessUpdate(changedFiles, context) {
var promises = [];
if (changedFiles.some(function (cf) { return cf.ext === '.scss'; })) {
promises.push(bundle_components_1.bundleCoreComponents(context));
}
return Promise.all(promises);
}
exports.preprocessUpdate = preprocessUpdate;