From 1b196332f5c76d809ce06b10263af7772c8072bb Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 21 Jul 2017 13:35:40 +0200 Subject: [PATCH] chore(docs-app): only copy relevant assets This keeps the size of the docs-app build down. Especially needed to keep the size of the generated build .zip under 10MB, which is the limit for firebase / gcs https function transfers --- docs/app/assets/css/docs.css | 34 +++++++++++++++++++ docs/config/services/deployments/debug.js | 1 - docs/config/services/deployments/default.js | 3 +- docs/config/services/deployments/jquery.js | 1 - .../config/services/deployments/production.js | 3 +- docs/gulpfile.js | 19 ++++++----- 6 files changed, 47 insertions(+), 14 deletions(-) diff --git a/docs/app/assets/css/docs.css b/docs/app/assets/css/docs.css index 77fcdbd400da..020b42a69b26 100644 --- a/docs/app/assets/css/docs.css +++ b/docs/app/assets/css/docs.css @@ -1,3 +1,37 @@ +@font-face { + font-family: 'Open Sans'; + src: url("../components/open-sans-fontface-1.4.0/fonts/Regular/OpenSans-Regular.eot?v=1.1.0"); + src: url("../components/open-sans-fontface-1.4.0/fonts/Regular/OpenSans-Regular.eot?#iefix&v=1.1.0") format("embedded-opentype"), + url("../components/open-sans-fontface-1.4.0/fonts/Regular/OpenSans-Regular.woff?v=1.1.0") format("woff"), + url("../components/open-sans-fontface-1.4.0/fonts/Regular/OpenSans-Regular.ttf?v=1.1.0") format("truetype"), + url("../components/open-sans-fontface-1.4.0/fonts/Regular/OpenSans-Regular.svg?v=1.1.0#OpenSansBold") format("svg"); + font-weight: normal; + font-style: normal; +} + +@font-face { + font-family: 'Open Sans'; + src: url("../components/open-sans-fontface-1.4.0/fonts/Semibold/OpenSans-Semibold.eot?v=1.1.0"); + src: url("../components/open-sans-fontface-1.4.0/fonts/Semibold/OpenSans-Semibold.eot?#iefix&v=1.1.0") format("embedded-opentype"), + url("../components/open-sans-fontface-1.4.0/fonts/Semibold/OpenSans-Semibold.woff?v=1.1.0") format("woff"), + url("../components/open-sans-fontface-1.4.0/fonts/Semibold/OpenSans-Semibold.ttf?v=1.1.0") format("truetype"), + url("../components/open-sans-fontface-1.4.0/fonts/Semibold/OpenSans-Semibold.svg?v=1.1.0#OpenSansBold") format("svg"); + font-weight: 600; + font-style: normal; +} + + +@font-face { + font-family: 'Open Sans'; + src: url("../components/open-sans-fontface-1.4.0/fonts/Bold/OpenSans-Bold.eot?v=1.1.0"); + src: url("../components/open-sans-fontface-1.4.0/fonts/Bold/OpenSans-Bold.eot?#iefix&v=1.1.0") format("embedded-opentype"), + url("../components/open-sans-fontface-1.4.0/fonts/Bold/OpenSans-Bold.woff?v=1.1.0") format("woff"), + url("../components/open-sans-fontface-1.4.0/fonts/Bold/OpenSans-Bold.ttf?v=1.1.0") format("truetype"), + url("../components/open-sans-fontface-1.4.0/fonts/Bold/OpenSans-Bold.svg?v=1.1.0#OpenSansBold") format("svg"); + font-weight: bold; + font-style: normal; +} + html, body { position: relative; height: 100%; diff --git a/docs/config/services/deployments/debug.js b/docs/config/services/deployments/debug.js index 6c61881232fc..b2b9da22b842 100644 --- a/docs/config/services/deployments/debug.js +++ b/docs/config/services/deployments/debug.js @@ -31,7 +31,6 @@ module.exports = function debugDeployment(getVersion) { ], stylesheets: [ 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.css', - 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/angular-topnav.css', 'css/docs.css', diff --git a/docs/config/services/deployments/default.js b/docs/config/services/deployments/default.js index 96f93f1d73b4..eb1778a91903 100644 --- a/docs/config/services/deployments/default.js +++ b/docs/config/services/deployments/default.js @@ -17,7 +17,7 @@ module.exports = function defaultDeployment(getVersion) { '../angular-sanitize.min.js', '../angular-touch.min.js', '../angular-animate.min.js', - 'components/marked-' + getVersion('marked') + '/lib/marked.js', + 'components/marked-' + getVersion('marked') + '/marked.min.js', 'js/angular-bootstrap/dropdown-toggle.min.js', 'components/lunr-' + getVersion('lunr') + '/lunr.min.js', 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', @@ -31,7 +31,6 @@ module.exports = function defaultDeployment(getVersion) { ], stylesheets: [ 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css', - 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/angular-topnav.css', 'css/docs.css', diff --git a/docs/config/services/deployments/jquery.js b/docs/config/services/deployments/jquery.js index cb4e1b0956fb..592de9dffabb 100644 --- a/docs/config/services/deployments/jquery.js +++ b/docs/config/services/deployments/jquery.js @@ -35,7 +35,6 @@ module.exports = function jqueryDeployment(getVersion) { ], stylesheets: [ 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css', - 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/angular-topnav.css', 'css/docs.css', diff --git a/docs/config/services/deployments/production.js b/docs/config/services/deployments/production.js index 69a62ebba577..859c490388ba 100644 --- a/docs/config/services/deployments/production.js +++ b/docs/config/services/deployments/production.js @@ -34,7 +34,7 @@ module.exports = function productionDeployment(getVersion) { cdnUrl + '/angular-sanitize.min.js', cdnUrl + '/angular-touch.min.js', cdnUrl + '/angular-animate.min.js', - 'components/marked-' + getVersion('marked') + '/lib/marked.js', + 'components/marked-' + getVersion('marked') + '/marked.min.js', 'js/angular-bootstrap/dropdown-toggle.min.js', 'components/lunr-' + getVersion('lunr') + '/lunr.min.js', 'components/google-code-prettify-' + getVersion('google-code-prettify') + '/src/prettify.js', @@ -48,7 +48,6 @@ module.exports = function productionDeployment(getVersion) { ], stylesheets: [ 'components/bootstrap-' + getVersion('bootstrap') + '/css/bootstrap.min.css', - 'components/open-sans-fontface-' + getVersion('open-sans-fontface') + '/open-sans.css', 'css/prettify-theme.css', 'css/angular-topnav.css', 'css/docs.css', diff --git a/docs/gulpfile.js b/docs/gulpfile.js index 1c092f431483..e45c504b6537 100644 --- a/docs/gulpfile.js +++ b/docs/gulpfile.js @@ -52,13 +52,14 @@ var getMergedEslintConfig = function(filepath) { }; }; -var copyComponent = function(component, pattern, sourceFolder, packageFile) { +var copyComponent = function(component, pattern, base, sourceFolder, packageFile) { pattern = pattern || '/**/*'; + base = base || ''; sourceFolder = sourceFolder || '../node_modules'; packageFile = packageFile || 'package.json'; var version = require(path.resolve(sourceFolder, component, packageFile)).version; return gulp - .src(sourceFolder + '/' + component + pattern) + .src(sourceFolder + '/' + component + pattern, {base: sourceFolder + '/' + component + '/' + base}) .pipe(gulp.dest(outputFolder + '/components/' + component + '-' + version)); }; @@ -96,12 +97,14 @@ gulp.task('assets', function() { .pipe(gulp.dest(outputFolder)); } })), - copyComponent('bootstrap', '/dist/**/*'), - copyComponent('open-sans-fontface'), - copyComponent('lunr', '/*.js'), - copyComponent('google-code-prettify'), - copyComponent('jquery', '/dist/*.js'), - copyComponent('marked', '/**/*.js') + copyComponent('bootstrap', '/dist/css/bootstrap?(.min).css', 'dist'), + copyComponent('bootstrap', '/dist/fonts/*', 'dist'), + copyComponent('open-sans-fontface', '/fonts/{Regular,Semibold,Bold}/*'), + copyComponent('lunr', '/lunr?(.min).js'), + copyComponent('google-code-prettify', '/**/{lang-css,prettify}.js'), + copyComponent('jquery', '/dist/jquery.js', 'dist'), + copyComponent('marked', '/lib/marked.js'), + copyComponent('marked', '/marked.min.js') ); });