foremark
Version:
A technology for writing semi-plain text documents that extends upon the concept of Markdeep.
45 lines • 2.05 kB
JavaScript
// This module is loaded strictly before the stage1 loader.
if ('あ'.charCodeAt(0) !== 0x3042) {
throw new Error('The application was loaded with a wrong encoding.');
}
console.log("\n%cForemark%c " + process.env.VERSION + " (" + process.env.URL + ")\n\n%cRevision: %c" + process.env.COMMITHASH + "@" + process.env.BRANCH + "\n\n", 'font-size: 150%; font-style: italic;', '', 'font-size: 80%;', 'font-size: 80%; font-family: monospace;');
// Guess the public path based on the script tag.
//
// Without this, late loaded resources (webpack lazy loaded chunks
// and fonts referenced by stylesheets) will not load.
var script = document.querySelector('script[data-rel=foremark]');
if (!script) {
// `currentScript` is widely supported by modern web browsers.
script = document.currentScript;
}
if (!script) {
// Use heuristics to guess which script tag is ours.
for (var list = document.getElementsByTagName('script'), i = 0; i < list.length; ++i) {
var src = list[i].src;
if (/\/foremark(\.bundle)?\.js(\?[^#?.]*)?(#[^#?]*)?$/.test(src)) {
script = list[i];
}
}
}
var basePathMatch = script && script.src.match(/^(.*?)[^\/]+$/);
if (basePathMatch) {
__webpack_public_path__ = basePathMatch[1];
}
// Create `<head>` if it doesn't exist yet
//
// This must be done before a module generated by `style-loader` is loaded so
// that the module can find a `head` tag to inject a style tag into.
var head = document.getElementsByTagName('head')[0];
if (!head) {
document.getElementsByTagName('html')[0].appendChild(document.createElement('head'));
}
// Create `<body>` if it doesn't exist yet
var body = document.getElementsByTagName('body')[0];
if (!body) {
document.getElementsByTagName('html')[0].appendChild(document.createElement('body'));
}
// If we use `import` here, the TypeScript compiler would move it to the top of
// this script, defeating the purpose of this module.
require('./browser-stage1').browserMain();
//# sourceMappingURL=browser-stage0.js.map
;