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
This commit is contained in:
Martin Staffa
2018-02-18 20:35:55 +01:00
committed by Martin Staffa
parent 77917e34c9
commit 02fb980de6
3 changed files with 8 additions and 19 deletions
+7 -5
View File
@@ -341,15 +341,17 @@ module.exports = function(grunt) {
},
{
cwd: 'build/docs',
src: ['**', '!ptore2e/**'],
src: ['**', '!ptore2e/**', '!index*.html'],
dest: 'deploy/docs/',
expand: true
},
{
src: ['build/docs/index-production.html'],
dest: docsScriptFolder + '/functions/content',
expand: true,
flatten: true
src: 'build/docs/index-production.html',
dest: 'deploy/docs/index.html'
},
{
src: 'build/docs/index-production.html',
dest: docsScriptFolder + '/functions/content/index.html'
},
{
cwd: 'build/docs',
@@ -1,11 +1,6 @@
{
"hosting": {
"public": "../../deploy/docs",
"ignore": [
"/index.html",
"/index-debug.html",
"/index-jquery.html"
],
"redirects": [
{
"source": "/error/:namespace\\::error*",
@@ -14,14 +9,6 @@
}
],
"rewrites": [
{
"source": "/",
"destination": "/index-production.html"
},
{
"source": "/index.html",
"destination": "/index-production.html"
},
{
"source": "**/*!(.@(jpg|jpeg|gif|png|html|js|map|json|css|svg|ttf|txt|woff|woff2|eot|xml))",
"function": "sendFile"
@@ -25,7 +25,7 @@ const buildSnapshot = data => `<!DOCTYPE html>
function sendFile(request, response) {
const snapshotRequested = typeof request.query._escaped_fragment_ !== 'undefined';
const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index-production'}.html`;
const filePath = `content/${snapshotRequested ? `partials${request.path}` : 'index'}.html`;
if (snapshotRequested) {
fs.readFile(filePath, {encoding: 'utf8'}, (error, data) => {