vulcanize strips comments now

This commit is contained in:
AJ Ortega
2015-04-30 11:06:36 -07:00
parent b197f05d4a
commit eff005d8a2
4 changed files with 25 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
<!--
<html><head><meta charset="UTF-8"><!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@@ -6,7 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><meta charset="UTF-8"><script>Polymer = {
--><script>Polymer = {
Settings: function () {
var user = window.Polymer || {};
location.search.slice(1).split('&').forEach(function (o) {

View File

@@ -1,4 +1,4 @@
<!--
<html><head><meta charset="UTF-8"><!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@@ -6,7 +6,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><meta charset="UTF-8"><link rel="import" href="polymer-micro.html">
--><link rel="import" href="polymer-micro.html">
<script>Polymer.Base._addFeature({
_prepTemplate: function () {
this._template = this._template || Polymer.DomModule.import(this.is, 'template');

25
dist/polymer.html vendored
View File

@@ -1,4 +1,12 @@
<!--
<html><head><meta charset="UTF-8"><!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
@@ -6,7 +14,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><meta charset="UTF-8"><link rel="import" href="polymer-mini.html">
--><link rel="import" href="polymer-mini.html">
<script>(function (scope) {
function withDependencies(task, depends) {
depends = depends || [];
@@ -1144,7 +1152,7 @@ this._config = config;
this._distributeConfig(this._config);
},
_configureProperties: function (properties, config) {
for (i in properties) {
for (var i in properties) {
var c = properties[i];
if (c.value !== undefined) {
var value = c.value;
@@ -2591,6 +2599,13 @@ observers: ['_itemsChanged(items.*)'],
created: function () {
this.boundCollectionObserver = this.render.bind(this);
},
detached: function () {
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
this._detachRow(i);
}
}
},
ready: function () {
if (!this.ctor) {
this.templatize(this);
@@ -2598,14 +2613,14 @@ this.templatize(this);
},
_sortChanged: function () {
var dataHost = this._getRootDataHost();
this._sortFn = this.sort && (typeof this.sort == 'function' ? this.sort : dataHost[this.sort].bind(this.host));
this._sortFn = this.sort && (typeof this.sort == 'function' ? this.sort : dataHost[this.sort].bind(dataHost));
if (this.items) {
this.debounce('render', this.render);
}
},
_filterChanged: function () {
var dataHost = this._getRootDataHost();
this._filterFn = this.filter && (typeof this.filter == 'function' ? this.filter : dataHost[this.filter].bind(this.host));
this._filterFn = this.filter && (typeof this.filter == 'function' ? this.filter : dataHost[this.filter].bind(dataHost));
if (this.items) {
this.debounce('render', this.render);
}

View File

@@ -12,6 +12,7 @@ function vulcanize(filename, dstdir, excludes) {
});
cmd = cmd + ' --implicit-strip';
}
cmd = cmd + ' --strip-comments';
cmd = cmd + ' ' + filename + ' > ' + dstdir + '/' + filename;
return cmd
}
@@ -27,8 +28,6 @@ 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(/<!--((?!@license)[^])*?-->/g, ''))
// Reduce script tags
.pipe(replace(/<\/script>\s*<script>/g, '\n'))
// Collapse newlines