foundry-dsa41-game/node_modules/sass-build/dist/cli/commands/compile/compile.js

52 lines
2.0 KiB
JavaScript

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var compile_exports = {};
__export(compile_exports, {
cliCompile: () => cliCompile
});
module.exports = __toCommonJS(compile_exports);
var import_utils = require("../../../utils");
var import_validate_params = require("./validate-params");
var import_compile = require("../../../compile");
function cliCompile(params) {
try {
(0, import_validate_params.validateParams)(params);
} catch (err) {
(0, import_utils.exit)(1, "error", "cli > compile", err.message);
}
const { file, source } = params;
let css = "";
if (file) {
import_utils.logger.silly("cli > compile", "File passed.");
import_utils.logger.silly("cli > compile", " Attempting to compile...");
css = (0, import_compile.sassCompile)(file);
import_utils.logger.silly("cli > compile", " Compile successful.");
}
if (source) {
import_utils.logger.silly("cli > compile", "Source passed.");
import_utils.logger.silly("cli > compile", " Attempting to compile...");
css = (0, import_compile.sassCompileString)(source);
import_utils.logger.silly("cli > compile", " Compile successful.");
}
process.stdout.write(css);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
cliCompile
});