Georgios Kalpakas d0bc83ca27 build(aio): implement prerendering
The current implementation is based on @igorminar's [angular-io-v42][1]. It is
using Protractor to request all docs URLs, let them fallback to `/index.html`
and save the rendered page.

[1]: https://github.com/IgorMinar/angular-io-v42/tree/05508ab3/tools/prerenderer

Fixes #15104
2017-03-17 15:31:22 -05:00

31 lines
661 B
JavaScript

'use strict';
// Imports
const path = require('path');
// Constants
const BROWSER_INSTANCES = 7;
const PORT = 4201;
const BASE_URL = `http://localhost:${PORT}`;
const ROOT_DIR = path.join(__dirname, '../..');
const DIST_DIR = path.join(ROOT_DIR, 'dist');
const CONTENT_DIR = path.join(DIST_DIR, 'content');
const INPUT_DIR = path.join(CONTENT_DIR, 'docs');
const TMP_SPECS_DIR = path.join(ROOT_DIR, 'tmp/docs-prerender-specs');
const TMP_OUTPUT_DIR = path.join(ROOT_DIR, 'tmp/docs-prerendered');
// Exports
module.exports = {
BASE_URL,
BROWSER_INSTANCES,
CONTENT_DIR,
DIST_DIR,
INPUT_DIR,
PORT,
ROOT_DIR,
TMP_OUTPUT_DIR,
TMP_SPECS_DIR
};