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
// packages/utils/tests/factories.ts | |
// import { createHash } from 'crypto'; | |
import faker from 'faker'; | |
/** | |
* Seed the random sequence that generates the random values. | |
* @param sentence Any string to use as seed | |
*/ | |
export function seed(sentence: string) { |
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
/* | |
* When we have a workbox we must be sure to just render the | |
* app when we assert that we are running the latest version. | |
* Otherwise the user can start interacting with the app and | |
* right after an update arrives and the page is reloaded. | |
*/ | |
if (wb != null) { | |
wb.active | |
.then((serviceWorker) => { | |
/* When the service worker active is not controlling the |
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
// Put this on the top of your entry file or use Node's `-r` cli option | |
const { Module } = require("module"); | |
const originalResolveLookupPaths = Module._resolveLookupPaths; | |
Module._resolveLookupPaths = function(request, parent) { | |
const paths = originalResolveLookupPaths.call(Module, request, parent); | |
if (request.startsWith(".")) return paths; |
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 resolve = require('resolve'); | |
/** | |
* @typedef {{ | |
basedir: string; | |
browser?: boolean; | |
defaultResolver: (request: string, options: ResolverOptions) => string; | |
extensions?: readonly string[]; | |
moduleDirectory?: readonly string[]; | |
paths?: readonly string[]; |
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
Show hidden characters
{ | |
"compilerOptions": { | |
/* Basic Options */ | |
"target": "es2018", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ | |
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | |
"lib": ["es2018"], /* Specify library files to be included in the compilation. */ | |
"resolveJsonModule": true, | |
// "allowJs": true, /* Allow javascript files to be compiled. */ | |
// "checkJs": true, /* Report errors in .js files. */ | |
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ |
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 isProduction = process.env.NODE_ENV === 'production'; | |
const isTest = process.env.NODE_ENV === 'test'; | |
module.exports = { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
targets: { | |
chrome: '65', |
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
{ | |
"compilerOptions": { | |
/* Basic Options */ | |
"target": "es2018", | |
"module": "es2015", | |
"resolveJsonModule": false, // Don't use untill fixed: https://github.com/Microsoft/TypeScript/issues/26020 | |
"lib": ["dom", "esnext"], | |
"allowJs": false, | |
"jsx": "preserve", | |
"sourceMap": true, |
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
coverage | |
build | |
dist |
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 history = require('connect-history-api-fallback'); | |
const convert = require('koa-connect'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); | |
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); |