-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove `grid` from style libs, update prompts, change default css engine to `scss`. * Add `static` directory, favicon set, `site.webmanifest` file. * Add task to generate service-workers using `workbox`. * Add `postcss`, `postcss-custom-properties`.
- Loading branch information
1 parent
b3b457d
commit db13786
Showing
57 changed files
with
577 additions
and
2,590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import gulp from 'gulp' | ||
import colors from 'ansi-colors' | ||
import { generateSW } from 'workbox-build' | ||
import { dest } from '../config' | ||
|
||
// Don' t cache scripts and files if has theese words in path. | ||
const urlPattern = ({ url }) => | ||
![ | ||
'adminlte', | ||
'bootstrap', | ||
'pjax', | ||
'fontawesome', | ||
'font-awesome', | ||
'glyphicons', | ||
'all-skins', | ||
'gridview', | ||
'backend', | ||
'phpmyadmin', | ||
'google', | ||
'ringostat', | ||
].find(excp => url.href.toLowerCase().includes(excp)) | ||
|
||
gulp.task('sw', () => { | ||
if (!process.env.WEBPACK_HASH) { | ||
throw new Error( | ||
`Environment variable ${colors.green('WEBPACK_HASH')} has to be specified via webpack task.` | ||
) | ||
} | ||
|
||
return generateSW({ | ||
globDirectory: dest.root, | ||
globPatterns: ['**/*.{json,js,css,woff2,ico,png,jpg,svg,xml}'], | ||
globIgnores: ['assets/**', 'img/**', '*.map*', '*manifest', 'sw.js', '.htaccess'], | ||
swDest: dest.sw, | ||
additionalManifestEntries: [ | ||
{ url: '/', revision: process.env.WEBPACK_HASH }, // Precashe start_url | ||
], | ||
|
||
// Define runtime caching rules. | ||
runtimeCaching: [ | ||
{ | ||
// Match callback function. (https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-routing#%7EmatchCallback) | ||
urlPattern, | ||
// Apply a cache-first strategy. | ||
handler: 'CacheFirst', | ||
options: { | ||
// Use a custom cache name. | ||
cacheName: 'runtime-v1', | ||
// Plugins | ||
cacheableResponse: { | ||
statuses: [0, 200], | ||
}, | ||
expiration: { | ||
maxEntries: 500, | ||
maxAgeSeconds: 60 * 60 * 24, // 24 hours | ||
}, | ||
}, | ||
}, | ||
], | ||
}) | ||
}) | ||
|
||
const build = gulp => gulp.parallel('sw') | ||
|
||
module.exports.build = build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import notify from 'gulp-notify' | ||
|
||
module.exports = function () { | ||
const args = Array.prototype.slice.call(arguments) | ||
module.exports = function (args) { | ||
notify | ||
.onError({ | ||
title: 'Compile Error', | ||
message: '<%= error.message %>', | ||
sound: 'Submarine', | ||
}) | ||
.apply(this, args) | ||
.apply(this, [args]) | ||
|
||
this.emit('end') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.