UNPKG

@react-gnome/core

Version:

## Getting Started

62 lines (60 loc) 2.61 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; 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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/utils/get-entrypoint.ts var get_entrypoint_exports = {}; __export(get_entrypoint_exports, { getEntrypoint: () => getEntrypoint }); module.exports = __toCommonJS(get_entrypoint_exports); var import_path = __toESM(require("path")); var import_get_polyfills = require("./get-polyfills.cjs"); var import_get_runtime_init = require("./get-runtime-init.cjs"); function getEntrypoint(program) { const userEntrypointPath = import_path.default.resolve( program.cwd, program.config.entrypoint ); const lines = []; lines.push("// Runtime initialization"); for (const initfile of (0, import_get_runtime_init.getRuntimeInitImportPaths)(program)) { lines.push(`import ${JSON.stringify(initfile)};`); } lines.push(""); lines.push("// Register global polyfills"); for (const polyfill of (0, import_get_polyfills.getGlobalPolyfillsInmportPaths)(program)) { lines.push(`import ${JSON.stringify(polyfill)};`); } for (const customPolly of (0, import_get_polyfills.getCustomPolyfillsImports)(program)) { lines.push(customPolly); } lines.push(""); lines.push("// User entrypoint"); lines.push(`import ${JSON.stringify(userEntrypointPath)};`); return lines.join("\n"); }