-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathindex.js
More file actions
19 lines (16 loc) · 1022 Bytes
/
index.js
File metadata and controls
19 lines (16 loc) · 1022 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const fs = require('fs');
const path = require('path');
function getStaticRedirects() {
// Load redirects directly within this module
const docsRedirects = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'redirects/docs.json'), 'utf-8'));
const legacyRedirects = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'redirects/legacy_setup_docs.json'), 'utf-8'));
const refarchRedirects = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'redirects/refarch.json'), 'utf-8'));
const deprecatedRedirects = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'redirects/deprecated.json'), 'utf-8'));
const componentsMigrationRedirects = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'redirects/components-migration.json'), 'utf-8'));
// Combine the loaded redirects into a single array
return [...docsRedirects, ...legacyRedirects, ...refarchRedirects, ...deprecatedRedirects, ...componentsMigrationRedirects];
}
// Export the plugin and helper functions
module.exports = {
getStaticRedirects,
};