From a9db1d2bf399c899d4e4cb2a38d4e957b870d4f8 Mon Sep 17 00:00:00 2001 From: Justin DuJardin Date: Sat, 12 Dec 2015 18:02:57 -0800 Subject: [PATCH] feat(build): add support for generating examples static site - for uploading to places. you know... --- .gitignore | 1 + Gruntfile.js | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a964b0f2..a1c69aa0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .idea dist/ out/ +site/ ng2-material/**/*.css ng2-material/**/*.css.map diff --git a/Gruntfile.js b/Gruntfile.js index ef29381b..fd2c3ae5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,9 +3,11 @@ module.exports = function (grunt) { pkg: grunt.file.readJSON('package.json'), sourceRoot: 'ng2-material', outPath: 'out', + sitePath: 'site', clean: [ "dist/", "<%- outPath %>/", + "<%- sitePath %>/", "<%- sourceRoot %>/**/*.js", "<%- sourceRoot %>/**/*.d.ts", "<%- sourceRoot %>/**/*.js.map", @@ -25,7 +27,6 @@ module.exports = function (grunt) { {expand: true, cwd: 'ng2-material/', src: ['**/*.html'], dest: '<%- outPath %>/'}, // Source .ts/.scss files for people that prefer to build. - // TODO: this gets the .d.ts files as well. consider removing them. {expand: true, cwd: 'ng2-material/', src: ['**/*.scss'], dest: '<%- outPath %>/source'}, {expand: true, cwd: 'ng2-material/', src: ['**/*.ts'], dest: '<%- outPath %>/source'}, @@ -37,6 +38,27 @@ module.exports = function (grunt) { // Material Icons web font {expand: true, cwd: 'public/', src: ['font/*.*'], dest: '<%- outPath %>/'} ] + }, + // Examples site all nicely packaged up for uploading to an FTP. + site: { + files: [ + { + expand: true, + src: [ + './node_modules/systemjs/dist/*.js', + './node_modules/angular2/bundles/angular2.dev.js', + './node_modules/angular2/typings/**/*' + ], + dest: '<%- sitePath %>/<%- pkg.version %>/' + }, + + {expand: true, src: 'package.json', dest: '<%- sitePath %>/<%- pkg.version %>/'}, + {expand: true, src: 'index.html', dest: '<%- sitePath %>/<%- pkg.version %>/'}, + {expand: true, src: 'config.js', dest: '<%- sitePath %>/<%- pkg.version %>/'}, + {expand: true, src: 'ng2-material/**/*', dest: '<%- sitePath %>/<%- pkg.version %>/'}, + {expand: true, src: 'public/**/*', dest: '<%- sitePath %>/<%- pkg.version %>/'}, + {expand: true, src: 'examples/**/*', dest: '<%- sitePath %>/<%- pkg.version %>/'} + ] } }, notify: {