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
{ | |
"short_name": "React Boilerplate App", | |
"name": "React Boilerplate App", | |
"description": "A PWA boilerplate/reference application in React", | |
"icons": [ | |
{ | |
"src": "/vercel-icon-192x192.png", | |
"type": "image/png", | |
"sizes": "192x192", | |
"purpose": "any maskable" |
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
//Update this array to catch more errors | |
const HYDRATION_ERROR_MSGS = [ | |
"Warning: Did not expect server HTML to contain", | |
"Warning: Text content did not match. Server", | |
]; | |
//Can use any npm packag instead of this | |
const interpolate = (template, params) => | |
params.reduce((p, c) => p.replace(/%s/, c), template); |
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
const glob = require("glob"); | |
const path = require("path"); | |
const configs = []; | |
glob.sync("./lh-reports/*.json").forEach(file => { | |
configs.push(require(path.resolve(file))); | |
}); | |
const stats = { | |
FCP: { value: 0, unit: "s" }, |
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
namespace PWAUtils | |
{ | |
public static class BrowserDetection | |
{ | |
static readonly Dictionary<string, string> browserMapping = new Dictionary<string, string> | |
{ | |
//For mobile devices | |
{ "Chrome Mobile", "71" }, | |
{ "Firefox Mobile", "64" }, | |
{ "Samsung Browser", "8.2" }, |
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
const path = require("path"); | |
const modernBabelConfig = require("babel.modern.config.js"); | |
module.exports = { | |
context: path.resolve(__dirname, "src"), | |
resolve: { | |
extensions: [".js", ".jsx"], | |
alias: {...}, | |
modules: [ | |
path.resolve(__dirname, "src"), |
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
const path = require("path"); | |
const legacyBabelConfig = require("babel.legacy.config.js"); | |
module.exports = { | |
context: path.resolve(__dirname, "src"), | |
resolve: { | |
extensions: [".js", ".jsx"], | |
alias: {...}, | |
modules: [ | |
path.resolve(__dirname, "src"), |
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
const commonPlugins = require("./commonPlugins"); | |
module.exports = api => { | |
api && api.cache(false); | |
const presets = [ | |
[ | |
"@babel/preset-env", | |
{ | |
targets: { esmodules: true }, //For ES6 supporting browsers | |
useBuiltIns: "usage", | |
corejs: 2, |
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
const commonPlugins = require("./commonPlugins"); | |
module.exports = api => { | |
api && api.cache(false); | |
const presets = [ | |
[ | |
"@babel/preset-env", | |
{ | |
targets: { browsers: ["safari >= 7"] }, //To support old browsers | |
useBuiltIns: "usage", | |
corejs: 2, |
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
/* | |
* Use spawn instead of exec for large ouput buffer | |
* https://www.hacksparrow.com/nodejs/difference-between-spawn-and-exec-of-node-js-child-rocess.html | |
*/ | |
const liveOuput = (command, args) => { | |
const childProcess = spawn(command, args, { shell: true }); | |
childProcess.stdout.on("data", data => { | |
console.log(data.toString()); | |
}); |
NewerOlder