Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Apr 17, 2017
1 parent 59350ad commit 36603bc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 14 deletions.
48 changes: 38 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ gulp.task('closure', ['clean'], () => {
full();

const project = new PolymerProject({
shell: `./${entry}`,
fragments: [
'bower_components/shadycss/apply-shim.html',
'bower_components/shadycss/custom-style-interface.html'
]
shell: `./${entry}`
});

const closureStream = closure({
Expand All @@ -123,7 +119,7 @@ gulp.task('closure', ['clean'], () => {
rewrite_polyfills: false,
new_type_inf: true,
externs: [
'externs/closure-upstream-externs.js',
// 'externs/closure-upstream-externs.js',
'externs/webcomponents-externs.js',
'externs/polymer-externs.js',
'externs/closure-types.js',
Expand All @@ -140,21 +136,53 @@ gulp.task('closure', ['clean'], () => {
.pipe(() => new OldNameStream(closureStream.fileList_))

// process source files in the project
const sources = project.sources()
const sources = project.sources();

// process dependencies
const dependencies = project.dependencies()
const dependencies = project.dependencies();

class Uniq extends Transform {
constructor() {
super({ objectMode: true });
this.map = {};
}
_transform(file, enc, cb) {
this.map[file.path] = file;
cb();
}
_flush(done) {
for (let filePath in this.map) {
let file = this.map[filePath];
this.push(file);
}
done();
}
}

class NoDeps extends Transform {
constructor() {
super({objectMode: true});
}
_transform(file, enc, cb) {
if (file.path.match(/shadycss/)) {
file.contents = new Buffer('');
}
cb(null, file);
}
}

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

const splitter = new polymer.HtmlSplitter();
return mergedFiles
.pipe(project.bundler)
.pipe(new NoDeps())
.pipe(project.bundler())
.pipe(new Uniq())
.pipe(splitter.split())
.pipe(new Log('saw:'))
.pipe(gulpif(splitRx, closurePipeline()))
.pipe(splitter.rejoin())
// .pipe(htmlmin({removeComments: true}))
.pipe(gulpif(joinRx, minimalDocument()))
.pipe(gulpif(joinRx, size({title: 'closure size', gzip: true, showTotal: false, showFiles: true})))
.pipe(gulp.dest(COMPILED_DIR))
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"test": "test"
},
"devDependencies": {
"babel-preset-babili": "0.0.10",
"babel-preset-babili": "0.0.12",
"del": "^2.2.1",
"dom5": "^1.3.1",
"eslint-plugin-html": "^1.3.0",
"google-closure-compiler": "^20170218.0.0",
"eslint-plugin-html": "^2.0.1",
"google-closure-compiler": "^20170409.0.0",
"gulp": "^3.9.1",
"gulp-audit": "^1.0.0",
"gulp-babel": "^6.1.2",
Expand All @@ -24,7 +24,7 @@
"gulp-vulcanize": "^6.0.1",
"lazypipe": "^1.0.1",
"merge-stream": "^1.0.1",
"polymer-build": "0.8.3",
"polymer-build": "^1.1.0",
"run-sequence": "^1.1.0",
"through2": "^2.0.0",
"web-component-tester": "^6.0.0-prerelease.4"
Expand Down

0 comments on commit 36603bc

Please sign in to comment.