diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..7bf6eb18f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bower_components +node_modules diff --git a/build.bat b/build.bat deleted file mode 100644 index 12479f7da9..0000000000 --- a/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -START /B vulcanize polymer-simplex.html --inline --strip -output dist/polymer-simplex.html -START /B vulcanize polymer.html --inline --strip -output dist/polymer.html diff --git a/dist/polymer-micro.html b/dist/polymer-micro.html new file mode 100644 index 0000000000..9a43e5a49f --- /dev/null +++ b/dist/polymer-micro.html @@ -0,0 +1,487 @@ + + + \ No newline at end of file diff --git a/dist/polymer-mini.html b/dist/polymer-mini.html new file mode 100644 index 0000000000..cd670fabd6 --- /dev/null +++ b/dist/polymer-mini.html @@ -0,0 +1,949 @@ + + + + \ No newline at end of file diff --git a/dist/polymer.html b/dist/polymer.html new file mode 100644 index 0000000000..078429c457 --- /dev/null +++ b/dist/polymer.html @@ -0,0 +1,3051 @@ + + + + \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000000..3e4d828893 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,43 @@ +var gulp = require('gulp'); +var replace = require('gulp-replace'); +var shell = require('gulp-shell'); + +var polyclean = require('polyclean'); + +function vulcanize(filename, dstdir, excludes) { + var cmd = 'node_modules/vulcanize/bin/vulcanize'; + if (excludes && excludes.length > 0) { + excludes.forEach(function(exclude) { + cmd = cmd + ' --exclude ' + exclude; + }); + cmd = cmd + ' --implicit-strip'; + } + cmd = cmd + ' ' + filename + ' > ' + dstdir + '/' + filename; + return cmd +} + +var micro = "polymer-micro.html"; +var mini = "polymer-mini.html"; +var max = "polymer.html"; + +gulp.task('micro', shell.task(vulcanize(micro, 'dist'))); +gulp.task('mini', shell.task(vulcanize(mini, 'dist', [micro]))); +gulp.task('max', shell.task(vulcanize(max, 'dist', [mini, micro]))); + +gulp.task('strip', ['micro', 'mini', 'max'], function() { + return gulp.src('dist/*.html') + .pipe(polyclean.cleanJsComments()) + // Get rid of erroneous html comments + .pipe(replace(//g, '')) + // Reduce script tags + .pipe(replace(/<\/script>\s*