UNPKG

shaman-website-compiler

Version:

Compile raw HTML, CSS and Javascript into the smallest possible, SEO friendly website.

68 lines 3.11 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SitemapConfig = exports.WebsiteConfig = void 0; var inversify_1 = require("inversify"); var adapter_config_1 = require("./adapter-config"); var WebsiteConfig = /** @class */ (function () { function WebsiteConfig(config) { if (config === void 0) { config = {}; } this.assetGlobs = [ "**/*.png", "**/*.svg", "**/*.ico", "**/*.jpg", "**/*.jpeg", "**/*.txt" ]; this.root = config.root || "./src"; this.logLevel = config.logLevel || "info"; this.production = config.production || false; this.pages = config.pages || ["**/*.html", "!**/*.partial.html"]; this.partials = config.partials || ["**/*.partial.html"]; this.helpers = config.helpers || ["**/*.helper.js"], this.scripts = config.scripts || ["**/*.js", "!**/*.helper.js"]; this.styles = config.styles || ["**/*.css"]; this.assets = config.assets || this.assetGlobs; this.output = config.output; this.serve = config.serve || !config.production; this.sitemap = config.sitemap || { hostname: 'http://localhost:3000/' }; this.adapter = config.adapter || this.defaultAdapter; if (!this.adapter.module) this.adapter.module = this.defaultAdapter.module; this.port = config.port || 3000; this.handlebars = config.handlebars || function () { }; } Object.defineProperty(WebsiteConfig.prototype, "defaultAdapter", { get: function () { var config = new adapter_config_1.AdapterConfig(); config.module = 'shaman-website-compiler'; config.name = 'JsonRepoAdapter'; config.configuration = { dataPath: null, models: [] }; return config; }, enumerable: false, configurable: true }); WebsiteConfig = __decorate([ (0, inversify_1.injectable)(), __metadata("design:paramtypes", [Object]) ], WebsiteConfig); return WebsiteConfig; }()); exports.WebsiteConfig = WebsiteConfig; var SitemapConfig = /** @class */ (function () { function SitemapConfig() { } return SitemapConfig; }()); exports.SitemapConfig = SitemapConfig; //# sourceMappingURL=website-config.js.map