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
This commit is contained in:

committed by
Miško Hevery

parent
b5b2fed54d
commit
d0bc83ca27
30
aio/tools/prerender/constants.js
Normal file
30
aio/tools/prerender/constants.js
Normal file
@ -0,0 +1,30 @@
|
||||
'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
|
||||
};
|
Reference in New Issue
Block a user