Skip to content

Commit dfaea38

Browse files
committed
chore(docs.angularjs.org): only deploy production index.html as entry file
Previously, we rewrote index.html to index-production.html, but Firebase ignored this, probably because an exact file match always takes priority. This lead to the problem thatthe root - angularjs.org - didn't include the angular.js source files from the CDN
1 parent 30f6861 commit dfaea38

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

Gruntfile.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,17 @@ module.exports = function(grunt) {
341341
},
342342
{
343343
cwd: 'build/docs',
344-
src: ['**', '!ptore2e/**'],
344+
src: ['**', '!ptore2e/**', '!index*.html'],
345345
dest: 'deploy/docs/',
346346
expand: true
347347
},
348348
{
349-
src: ['build/docs/index-production.html'],
350-
dest: docsScriptFolder + '/functions/content',
351-
expand: true,
352-
flatten: true
349+
src: 'build/docs/index-production.html',
350+
dest: 'deploy/docs/index.html'
351+
},
352+
{
353+
src: 'build/docs/index-production.html',
354+
dest: docsScriptFolder + '/functions/content/index.html'
353355
},
354356
{
355357
cwd: 'build/docs',

scripts/docs.angularjs.org-firebase/firebase.json

-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
22
"hosting": {
33
"public": "../../deploy/docs",
4-
"ignore": [
5-
"/index.html",
6-
"/index-debug.html",
7-
"/index-jquery.html"
8-
],
94
"redirects": [
105
{
116
"source": "/error/:namespace\\::error*",
@@ -14,14 +9,6 @@
149
}
1510
],
1611
"rewrites": [
17-
{
18-
"source": "/",
19-
"destination": "/index-production.html"
20-
},
21-
{
22-
"source": "/index.html",
23-
"destination": "/index-production.html"
24-
},
2512
{
2613
"source": "**/*!(.@(jpg|jpeg|gif|png|html|js|map|json|css|svg|ttf|txt|woff|woff2|eot|xml))",
2714
"function": "sendFile"

scripts/docs.angularjs.org-firebase/functions/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const buildSnapshot = data => `<!DOCTYPE html>
2525
function sendFile(request, response) {
2626

2727
const snapshotRequested = typeof request.query._escaped_fragment_ !== 'undefined';
28-
const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index-production'}.html`;
28+
const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index'}.html`;
2929

3030
if (snapshotRequested) {
3131
fs.readFile(filePath, {encoding: 'utf8'}, (error, data) => {

0 commit comments

Comments
 (0)