File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 3
3
const EmberApp = require ( 'ember-cli/lib/broccoli/ember-app' ) ;
4
4
const mergeTrees = require ( 'broccoli-merge-trees' ) ;
5
5
const funnel = require ( 'broccoli-funnel' ) ;
6
+ const { readdirSync } = require ( 'fs' ) ;
7
+
8
+ function buildRedirects ( ) {
9
+ const redirects = [ ] ;
10
+ const rfcs = readdirSync ( 'rfcs/text' ) ;
11
+
12
+ for ( let filename of rfcs ) {
13
+ const match = filename . match ( / ( \d + ) - .* / ) ;
14
+
15
+ const number = parseInt ( match [ 1 ] ) ;
16
+
17
+ redirects . push (
18
+ `/number/${ number } /id/${ filename . replace ( / \. m d $ / , '' ) } 301!`
19
+ ) ;
20
+ }
21
+
22
+ return redirects ;
23
+ }
6
24
7
25
module . exports = function ( defaults ) {
8
26
let app = new EmberApp ( defaults , {
@@ -20,6 +38,9 @@ module.exports = function (defaults) {
20
38
fingerprint : {
21
39
extensions : [ 'js' , 'css' , 'map' ] ,
22
40
} ,
41
+ 'ember-cli-netlify' : {
42
+ redirects : buildRedirects ( ) ,
43
+ } ,
23
44
} ) ;
24
45
25
46
// Use `app.import` to add additional libraries to the generated
You can’t perform that action at this time.
0 commit comments