Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Commit

Permalink
Add npm build step
Browse files Browse the repository at this point in the history
  • Loading branch information
robdodson committed Dec 20, 2016
1 parent ce544f7 commit 353c8de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 8 additions & 8 deletions ep60-firebase-build/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// Documentation on what goes into PolymerProject.
const path = require('path');
const gulp = require('gulp');
const mergeStream = require('merge-stream');
const del = require('del');
const polymerJsonPath = path.join(process.cwd(), 'polymer.json');
const polymerJSON = require(polymerJsonPath);
const polymer = require('polymer-build');
const polymerProject = new polymer.PolymerProject(polymerJSON);
const mergeStream = require('merge-stream');
const buildDirectory = 'build/bundled';
const del = require('del');

/**
* Waits for the given ReadableStream
Expand All @@ -42,17 +42,17 @@ function build() {
// Oh, well do you want to minify stuff? Go for it!
// Here's how splitHtml & gulpif work
.pipe(polymerProject.splitHtml())
// .pipe(gulpif(/\.js$/, new JSOptimizeStream(optimizeOptions.js)))
// .pipe(gulpif(/\.css$/, new CSSOptimizeStream(optimizeOptions.css)))
// .pipe(gulpif(/\.html$/, new HTMLOptimizeStream(optimizeOptions.html)))
// .pipe(gulpif(/\.js$/, uglify()))
// .pipe(gulpif(/\.css$/, cssSlam()))
// .pipe(gulpif(/\.html$/, htmlMinifier()))
.pipe(polymerProject.rejoinHtml());

// Okay now lets do the same to your dependencies
let depsStream = polymerProject.dependencies()
.pipe(polymerProject.splitHtml())
// .pipe(gulpif(/\.js$/, new JSOptimizeStream(optimizeOptions.js)))
// .pipe(gulpif(/\.css$/, new CSSOptimizeStream(optimizeOptions.css)))
// .pipe(gulpif(/\.html$/, new HTMLOptimizeStream(optimizeOptions.html)))
// .pipe(gulpif(/\.js$/, uglify()))
// .pipe(gulpif(/\.css$/, cssSlam()))
// .pipe(gulpif(/\.html$/, htmlMinifier()))
.pipe(polymerProject.rejoinHtml());

// Okay, now lets merge them into a single build stream.
Expand Down
5 changes: 1 addition & 4 deletions ep60-firebase-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
"version": "0.0.0",
"description": "A starting point for Polymer & Firebase apps",
"scripts": {
"build": "node --harmony-async-await `which gulp`"
"build": "gulp"
},
"license": "http://polymer.github.io/LICENSE.txt",
"bugs": {
"url": "https://github.com/PolymerElements/generator-polymer-init-firebase/issues"
},
"engines": {
"node": ">=4.0"
},
Expand Down

0 comments on commit 353c8de

Please sign in to comment.