Run the script in docker runtime
chmod +x webenv.sh
# load global envrionments with filter
(env | grep ^REACT_APP_ | webenv.sh) > env.js
Include <script>
in index.html
const escapeRegex = /([^\\])\./g; | |
export const normalizeToken = index => (str, prev) => { | |
if ( | |
typeof str === 'string' || | |
typeof str === 'number' || | |
typeof str === 'boolean') { | |
const groups = prev.toString() | |
.replace(escapeRegex, '$1¬') |
document.body.style.paddingBottom = '250px'; | |
const div = document.createElement('div'); | |
Object.assign(div.style, { | |
position: 'fixed', | |
bottom: 0, | |
left: 0, | |
right: 0, | |
height: '250px', | |
opacity: 0.90, | |
color: 'white', |
import React, { useState, useRef, useCallback } from "react"; | |
import Button from "./Button"; | |
function App() { | |
const [state, setState] = useState(""); | |
const ref = useRef(state); | |
const handleChange = useCallback(event => { | |
ref.current = event.target.value; | |
setState(event.target.value); | |
}, []); |
import React, { useState, useRef, useCallback } from "react"; | |
import Button from "./Button"; | |
function App() { | |
const [state, setState] = useState(""); | |
const ref = useRef(state); | |
const handleChange = useCallback(event => { | |
ref.current = event.target.value; | |
setState(event.target.value); | |
}, []); |
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
const env = process.env.NODE_ENV; | |
const publicPath = process.env.PUBLIC_PATH ? `${process.env.PUBLIC_PATH}/` : process.env.PUBLIC_PATH; | |
if (!['development', 'production'].includes(env)) { | |
throw new Error('Invalid NODE_ENV'); |
WITH RECURSIVE doc_key_and_value_recursive ( | |
KEY, | |
value | |
) AS ( | |
SELECT | |
t.key, | |
t.value | |
FROM | |
stories_collection AS item, | |
json_each(item.data) AS t |
Run the script in docker runtime
chmod +x webenv.sh
# load global envrionments with filter
(env | grep ^REACT_APP_ | webenv.sh) > env.js
Include <script>
in index.html
(?:^`{3})(?:(.*$\n)?((?:.|\n)*?))(?:`{3}$)
node getCoverage.js
=>
CoverageSummary {
data: {
lines: { total: 10, covered: 10, skipped: 0, pct: 10.0 },