Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"presets": ["es2015"],
"presets": ["env"],
// Remove the line below to enable ES2015 support.
"only": "gulpfile.babel.js",
// "only": "gulpfile.babel.js",
"retainLines": true
}
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
sudo: false
language: node_js
node_js:
- '8'
- '7'
- '6'
- '5'
- '4'
- '0.12'
6 changes: 3 additions & 3 deletions app/scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!
/**
*
* Web Starter Kit
* Copyright 2015 Google Inc. All rights reserved.
Expand All @@ -24,7 +24,7 @@
// and that the current page is accessed from a secure origin. Using a
// service worker from an insecure origin will trigger JS console errors. See
// http://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
var isLocalhost = Boolean(window.location.hostname === 'localhost' ||
const isLocalhost = Boolean(window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
Expand All @@ -46,7 +46,7 @@
if (navigator.serviceWorker.controller) {
// The updatefound event implies that registration.installing is set:
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
var installingWorker = registration.installing;
const installingWorker = registration.installing;

installingWorker.onstatechange = function() {
switch (installingWorker.state) {
Expand Down
13 changes: 8 additions & 5 deletions app/scripts/sw/runtime-caching.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*!
/**
*
* Web Starter Kit
* Copyright 2015 Google Inc. All rights reserved.
Expand All @@ -17,17 +17,20 @@
*
*/
/* eslint-env worker */
// global.toolbox is defined in a different script, sw-toolbox.js, which is part of the
// global.toolbox is defined in a different script,
// sw-toolbox.js, which is part of the
// https://github.com/GoogleChrome/sw-toolbox project.
// That sw-toolbox.js script must be executed first, so it needs to be listed before this in the
// That sw-toolbox.js script must be executed first,
// so it needs to be listed before this in the
// importScripts() call that the parent service worker makes.
(function(global) {
'use strict';

// See https://github.com/GoogleChrome/sw-toolbox/blob/6e8242dc328d1f1cfba624269653724b26fa94f1/README.md#toolboxroutergeturlpattern-handler-options
// and https://github.com/GoogleChrome/sw-toolbox/blob/6e8242dc328d1f1cfba624269653724b26fa94f1/README.md#toolboxfastest
// for more details on how this handler is defined and what the toolbox.fastest strategy does.
// for more details on how this handler is defined
// and what the toolbox.fastest strategy does.
global.toolbox.router.get('/(.*)', global.toolbox.fastest, {
origin: /\.(?:googleapis|gstatic)\.com$/
origin: /\.(?:googleapis|gstatic)\.com$/,
});
})(self);
38 changes: 19 additions & 19 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,25 @@ gulp.task('styles', () => {
// to enable ES2015 support remove the line `"only": "gulpfile.babel.js",` in the
// `.babelrc` file.
gulp.task('scripts', () =>
gulp.src([
// Note: Since we are not using useref in the scripts build pipeline,
// you need to explicitly list your scripts here in the right order
// to be correctly concatenated
'./app/scripts/main.js'
// Other scripts
])
.pipe($.newer('.tmp/scripts'))
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.sourcemaps.write())
.pipe(gulp.dest('.tmp/scripts'))
.pipe($.concat('main.min.js'))
.pipe($.uglify({preserveComments: 'some'}))
// Output files
.pipe($.size({title: 'scripts'}))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('dist/scripts'))
.pipe(gulp.dest('.tmp/scripts'))
gulp.src([
// Note: Since we are not using useref in the scripts build pipeline,
// you need to explicitly list your scripts here in the right order
// to be correctly concatenated
'./app/scripts/main.js'
// Other scripts
])
.pipe($.newer('.tmp/scripts'))
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.sourcemaps.write())
.pipe(gulp.dest('.tmp/scripts'))
.pipe($.concat('main.min.js'))
.pipe($.uglify())
// Output files
.pipe($.size({title: 'scripts'}))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('dist/scripts'))
.pipe(gulp.dest('.tmp/scripts'))
);

// Scan your HTML for assets & optimize them
Expand Down
35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,43 @@
"devDependencies": {
"apache-server-configs": "^2.14.0",
"babel-core": "^6.14.0",
"babel-preset-es2015": "^6.0.15",
"babel-eslint": "^8.0.1",
"babel-preset-env": "^1.6.0",
"browser-sync": "^2.14.0",
"del": "^2.2.2",
"eslint-config-google": "^0.3.0",
"del": "^3.0.0",
"eslint": "^4.8.0",
"eslint-config-google": "^0.9.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-babel": "^6.1.2",
"gulp-autoprefixer": "^4.0.0",
"gulp-babel": "^7.0.0",
"gulp-cache": "^0.4.5",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.2",
"gulp-eslint": "^1.1.1",
"gulp-htmlmin": "^2.0.0",
"gulp-eslint": "^4.0.0",
"gulp-htmlmin": "^3.0.0",
"gulp-if": "^2.0.1",
"gulp-imagemin": "^2.4.0",
"gulp-imagemin": "^3.4.0",
"gulp-load-plugins": "^1.2.4",
"gulp-newer": "^1.2.0",
"gulp-sass": "^2.3.2",
"gulp-sass": "^3.1.0",
"gulp-size": "^2.1.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.4",
"gulp-sourcemaps": "^2.6.1",
"gulp-uglify": "^3.0.0",
"gulp-useref": "^3.1.0",
"psi": "^2.0.4",
"run-sequence": "^1.0.1",
"sw-precache": "^3.2.0",
"psi": "^3.0.0",
"run-sequence": "^2.2.0",
"sw-precache": "^5.2.0",
"sw-toolbox": "^3.2.1"
},
"engines": {
"node": ">=0.12"
},
"private": true,
"scripts": {
"test": "gulp && git status | grep 'working directory clean' >/dev/null || (echo 'Please commit all changes generated by building'; exit 1)"
"test": "gulp && git status | grep 'working tree clean' >/dev/null || (echo 'Please commit all changes generated by building'; exit 1)"
},
"eslintConfig": {
"extends": "google"
"extends": "google",
"parser": "babel-eslint"
}
}
Loading