Skip to content

Commit 36603bc

Browse files
committed
update dependencies
1 parent 59350ad commit 36603bc

2 files changed

Lines changed: 42 additions & 14 deletions

File tree

‎gulpfile.js‎

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ gulp.task('closure', ['clean'], () => {
106106
full();
107107

108108
const project = new PolymerProject({
109-
shell: `./${entry}`,
110-
fragments: [
111-
'bower_components/shadycss/apply-shim.html',
112-
'bower_components/shadycss/custom-style-interface.html'
113-
]
109+
shell: `./${entry}`
114110
});
115111

116112
const closureStream = closure({
@@ -123,7 +119,7 @@ gulp.task('closure', ['clean'], () => {
123119
rewrite_polyfills: false,
124120
new_type_inf: true,
125121
externs: [
126-
'externs/closure-upstream-externs.js',
122+
// 'externs/closure-upstream-externs.js',
127123
'externs/webcomponents-externs.js',
128124
'externs/polymer-externs.js',
129125
'externs/closure-types.js',
@@ -140,21 +136,53 @@ gulp.task('closure', ['clean'], () => {
140136
.pipe(() => new OldNameStream(closureStream.fileList_))
141137

142138
// process source files in the project
143-
const sources = project.sources()
139+
const sources = project.sources();
144140

145141
// process dependencies
146-
const dependencies = project.dependencies()
142+
const dependencies = project.dependencies();
143+
144+
class Uniq extends Transform {
145+
constructor() {
146+
super({ objectMode: true });
147+
this.map = {};
148+
}
149+
_transform(file, enc, cb) {
150+
this.map[file.path] = file;
151+
cb();
152+
}
153+
_flush(done) {
154+
for (let filePath in this.map) {
155+
let file = this.map[filePath];
156+
this.push(file);
157+
}
158+
done();
159+
}
160+
}
161+
162+
class NoDeps extends Transform {
163+
constructor() {
164+
super({objectMode: true});
165+
}
166+
_transform(file, enc, cb) {
167+
if (file.path.match(/shadycss/)) {
168+
file.contents = new Buffer('');
169+
}
170+
cb(null, file);
171+
}
172+
}
147173

148174
// merge the source and dependencies streams to we can analyze the project
149175
const mergedFiles = mergeStream(sources, dependencies);
150176

151177
const splitter = new polymer.HtmlSplitter();
152178
return mergedFiles
153-
.pipe(project.bundler)
179+
.pipe(new NoDeps())
180+
.pipe(project.bundler())
181+
.pipe(new Uniq())
154182
.pipe(splitter.split())
183+
.pipe(new Log('saw:'))
155184
.pipe(gulpif(splitRx, closurePipeline()))
156185
.pipe(splitter.rejoin())
157-
// .pipe(htmlmin({removeComments: true}))
158186
.pipe(gulpif(joinRx, minimalDocument()))
159187
.pipe(gulpif(joinRx, size({title: 'closure size', gzip: true, showTotal: false, showFiles: true})))
160188
.pipe(gulp.dest(COMPILED_DIR))

‎package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"test": "test"
99
},
1010
"devDependencies": {
11-
"babel-preset-babili": "0.0.10",
11+
"babel-preset-babili": "0.0.12",
1212
"del": "^2.2.1",
1313
"dom5": "^1.3.1",
14-
"eslint-plugin-html": "^1.3.0",
15-
"google-closure-compiler": "^20170218.0.0",
14+
"eslint-plugin-html": "^2.0.1",
15+
"google-closure-compiler": "^20170409.0.0",
1616
"gulp": "^3.9.1",
1717
"gulp-audit": "^1.0.0",
1818
"gulp-babel": "^6.1.2",
@@ -24,7 +24,7 @@
2424
"gulp-vulcanize": "^6.0.1",
2525
"lazypipe": "^1.0.1",
2626
"merge-stream": "^1.0.1",
27-
"polymer-build": "0.8.3",
27+
"polymer-build": "^1.1.0",
2828
"run-sequence": "^1.1.0",
2929
"through2": "^2.0.0",
3030
"web-component-tester": "^6.0.0-prerelease.4"

0 commit comments

Comments
 (0)