Skip to content

Commit

Permalink
chore(docs-app): only copy relevant assets
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Narretz committed Jul 31, 2017
1 parent d91a6bd commit 1b19633
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 14 deletions.
34 changes: 34 additions & 0 deletions docs/app/assets/css/docs.css
Original file line number Diff line number Diff line change
@@ -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%;
Expand Down
1 change: 0 additions & 1 deletion docs/config/services/deployments/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions docs/config/services/deployments/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
1 change: 0 additions & 1 deletion docs/config/services/deployments/jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions docs/config/services/deployments/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
19 changes: 11 additions & 8 deletions docs/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};

Expand Down Expand Up @@ -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')
);
});

Expand Down

0 comments on commit 1b19633

Please sign in to comment.