optimize bundle sizes

This commit is contained in:
konstantin krivlenia
2020-02-22 00:48:22 -06:00
committed by Umputun
parent 390ecbe8d9
commit ffb41abfd4
13 changed files with 179 additions and 119 deletions
-3
View File
@@ -6,8 +6,6 @@ module.exports = {
targets: {
browsers: ['> 1%', 'android >= 4.4.4', 'ios >= 9', 'IE >= 11'],
},
useBuiltIns: 'usage',
corejs: 3,
},
],
[
@@ -18,5 +16,4 @@ module.exports = {
},
],
],
plugins: ['@babel/plugin-syntax-dynamic-import', ['@babel/plugin-transform-react-jsx', { pragma: 'h' }]],
};
+4 -4
View File
@@ -4,19 +4,19 @@ module.exports = [
limit: '2.5 KB',
},
{
limit: '92 KB',
limit: '68 KB',
path: 'public/remark.js',
},
{
limit: '77 KB',
limit: '55 KB',
path: 'public/last-comments.js',
},
{
path: 'public/deleteme.js',
limit: '32 KB',
limit: '18 KB',
},
{
path: 'public/counter.js',
limit: '32.5 KB',
limit: '1.05 KB',
},
];
+2
View File
@@ -2,4 +2,6 @@ export const BASE_URL: string =
// eslint-disable-next-line @typescript-eslint/no-explicit-any
((window as any).remark_config && (window as any).remark_config.host) || process.env.REMARK_URL!;
export const NODE_ID: string = process.env.REMARK_NODE!;
export const API_BASE = '/api/v1';
export const COMMENT_NODE_CLASSNAME_PREFIX = 'remark42__comment-';
export const COUNTER_NODE_CLASSNAME = 'remark42__counter';
+1 -2
View File
@@ -2,9 +2,8 @@ import { Sorting, AuthProvider, BlockingDuration, Theme } from './types';
import * as configConstant from './constants.config';
export const BASE_URL = configConstant.BASE_URL;
export const API_BASE = '/api/v1';
export const API_BASE = configConstant.API_BASE;
export const NODE_ID = configConstant.NODE_ID;
export const COUNTER_NODE_CLASSNAME = 'remark42__counter';
export const COMMENT_NODE_CLASSNAME_PREFIX = configConstant.COMMENT_NODE_CLASSNAME_PREFIX;
export const LAST_COMMENTS_NODE_CLASSNAME = 'remark42__last-comments';
export const DEFAULT_LAST_COMMENTS_MAX = 15;
+18 -5
View File
@@ -1,5 +1,5 @@
import 'intersection-observer';
import 'core-js/es/promise';
import 'regenerator-runtime/runtime';
import 'es6-promise/auto';
import 'focus-visible';
import '@webcomponents/custom-elements';
import './closest-polyfill';
@@ -15,16 +15,29 @@ export default async function loadPolyfills() {
)
return;
await import(/* webpackChunkName: "polyfills" */ 'core-js').then();
await import(/* webpackChunkName: "core-js" */ 'core-js').then();
return;
};
const fillFetch = async () => {
if ('fetch' in window) return;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await import(/* webpackChunkName: "polyfills" */ 'whatwg-fetch' as any).then();
await import(/* webpackChunkName: "whatwg-fetch" */ 'whatwg-fetch' as any).then();
};
await Promise.all([fillCoreJs(), fillFetch()]);
const fillIntersectionObserver = async () => {
if (
'IntersectionObserver' in window &&
'IntersectionObserverEntry' in window &&
'intersectionRatio' in window.IntersectionObserverEntry.prototype
) {
return;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
await import(/* webpackChunkName: "intersection-observer" */ 'intersection-observer' as any).then();
};
await Promise.all([fillCoreJs(), fillFetch(), fillIntersectionObserver()]);
return;
}
@@ -10,22 +10,30 @@ interface State {
ref: Element | undefined;
}
const instance_map: WeakMap<Element, Component<Props, State>> = new WeakMap();
let instanceMap: WeakMap<Element, Component<Props, State>>;
let observer: IntersectionObserver;
const observer = new IntersectionObserver(
entries => {
entries.forEach(e => {
const instance = instance_map.get(e.target);
if (!instance) return;
instance.setState({
inView: e.isIntersecting,
});
});
},
{
rootMargin: '50px',
function getObserver(): { observer: IntersectionObserver; instanceMap: WeakMap<Element, Component<Props, State>> } {
if (observer && instanceMap) {
return { observer, instanceMap };
}
);
instanceMap = new WeakMap<Element, Component<Props, State>>();
observer = new window.IntersectionObserver(
entries => {
entries.forEach(e => {
const instance = instanceMap.get(e.target);
if (!instance) return;
instance.setState({
inView: e.isIntersecting,
});
});
},
{
rootMargin: '50px',
}
);
return { observer, instanceMap };
}
export class InView extends Component<Props, State> {
state: State = {
@@ -37,13 +45,15 @@ export class InView extends Component<Props, State> {
if (this.state.ref === nextState.ref) return;
if (this.state.ref instanceof Element) {
const { observer, instanceMap } = getObserver();
observer.unobserve(this.state.ref);
instance_map.delete(this.state.ref);
instanceMap.delete(this.state.ref);
}
if (nextState.ref instanceof Element) {
const { observer, instanceMap } = getObserver();
observer.observe(nextState.ref);
instance_map.set(nextState.ref, this);
instanceMap.set(nextState.ref, this);
}
}
@@ -58,9 +68,9 @@ export class InView extends Component<Props, State> {
componentWillUnmount() {
if (!(this.state.ref instanceof Element)) return;
const { observer, instanceMap } = getObserver();
observer.unobserve(this.state.ref);
instance_map.delete(this.state.ref);
instanceMap.delete(this.state.ref);
}
render() {
+14 -12
View File
@@ -1,9 +1,6 @@
/* eslint-disable no-console */
declare let remark_config: CounterConfig;
import loadPolyfills from '@app/common/polyfills';
import api from './common/api';
import { COUNTER_NODE_CLASSNAME, BASE_URL } from '@app/common/constants';
import { COUNTER_NODE_CLASSNAME, BASE_URL, API_BASE } from '@app/common/constants.config';
import { CounterConfig } from '@app/common/config-types';
if (document.readyState === 'loading') {
@@ -12,11 +9,7 @@ if (document.readyState === 'loading') {
init();
}
async function init(): Promise<void> {
__webpack_public_path__ = BASE_URL + '/web/';
await loadPolyfills();
function init(): void {
const nodes: HTMLElement[] = [].slice.call(document.getElementsByClassName(COUNTER_NODE_CLASSNAME));
if (!nodes) {
@@ -43,7 +36,16 @@ async function init(): Promise<void> {
return acc;
}, {});
api.getCommentsCount(remark_config.site_id, Object.keys(map)).then(res => {
res.forEach(item => map[item.url].map(n => (n.innerHTML = item.count.toString(10))));
});
const oReq = new XMLHttpRequest();
oReq.onreadystatechange = function(this: XMLHttpRequest) {
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
try {
const res = JSON.parse(this.responseText) as { url: string; count: number }[];
res.forEach(item => map[item.url].map(n => (n.innerHTML = item.count.toString(10))));
} catch (e) {}
}
};
oReq.open('POST', `${BASE_URL}${API_BASE}/counts?site=${remark_config.site_id}`, true);
oReq.setRequestHeader('Content-Type', 'application/json');
oReq.send(JSON.stringify(Object.keys(map)));
}
+6 -1
View File
@@ -1,7 +1,12 @@
/* eslint-disable no-console, @typescript-eslint/camelcase */
/** @jsx createElement */
declare let remark_config: LastCommentsConfig;
// Must be the first import
if (process.env.NODE_ENV === 'development') {
// Must use require here as import statements are only allowed
// to exist at the top of a file.
require('preact/debug');
}
import loadPolyfills from '@app/common/polyfills';
import { createElement, render } from 'preact';
import 'preact/debug';
+6 -1
View File
@@ -1,8 +1,13 @@
/** @jsx createElement */
// Must be the first import
if (process.env.NODE_ENV === 'development') {
// Must use require here as import statements are only allowed
// to exist at the top of a file.
require('preact/debug');
}
import loadPolyfills from '@app/common/polyfills';
import { createElement, render } from 'preact';
import 'preact/debug';
import { bindActionCreators } from 'redux';
import { Provider } from 'react-redux';
+1 -1
View File
@@ -1,4 +1,4 @@
import isEqual from 'lodash/isEqual';
import isEqual from 'lodash-es/isEqual';
/**
* Deeply compares two entities,
+94 -66
View File
@@ -1815,6 +1815,15 @@
"@types/react": "*"
}
},
"@types/es6-promise": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@types/es6-promise/-/es6-promise-3.3.0.tgz",
"integrity": "sha512-ixCIAEkLUKv9movnHKCzx2rzAJgEnSALDXPrOSSwOjWwXFs0ssSZKan+O2e3FExPPCbX+DfA9NcKsbvLuyUlNA==",
"dev": true,
"requires": {
"es6-promise": "*"
}
},
"@types/eslint-visitor-keys": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
@@ -1906,6 +1915,15 @@
"integrity": "sha512-ogI4g9W5qIQQUhXAclq6zhqgqNUr7UlFaqDHbch7WLSLeeM/7d3CRaw7GLajxvyFvhJqw4Rpcz5bhoaYtIx6Tg==",
"dev": true
},
"@types/lodash-es": {
"version": "4.17.3",
"resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.3.tgz",
"integrity": "sha512-iHI0i7ZAL1qepz1Y7f3EKg/zUMDwDfTzitx+AlHhJJvXwenP682ZyGbgPSc5Ej3eEAKVbNWKFuwOadCj5vBbYQ==",
"dev": true,
"requires": {
"@types/lodash": "*"
}
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
@@ -5208,6 +5226,11 @@
"is-symbol": "^1.0.2"
}
},
"es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
@@ -6271,28 +6294,28 @@
"dependencies": {
"abbrev": {
"version": "1.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"dev": true,
"optional": true
},
"ansi-regex": {
"version": "2.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
"resolved": false,
"resolved": "",
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"dev": true,
"optional": true
},
"are-we-there-yet": {
"version": "1.1.5",
"resolved": false,
"resolved": "",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"dev": true,
"optional": true,
@@ -6303,14 +6326,14 @@
},
"balanced-match": {
"version": "1.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": false,
"resolved": "",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"optional": true,
@@ -6321,42 +6344,42 @@
},
"chownr": {
"version": "1.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
"dev": true,
"optional": true
},
"code-point-at": {
"version": "1.1.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true,
"optional": true
},
"debug": {
"version": "4.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"dev": true,
"optional": true,
@@ -6366,28 +6389,28 @@
},
"deep-extend": {
"version": "0.6.0",
"resolved": false,
"resolved": "",
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"dev": true,
"optional": true
},
"delegates": {
"version": "1.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
"dev": true,
"optional": true
},
"detect-libc": {
"version": "1.0.3",
"resolved": false,
"resolved": "",
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"dev": true,
"optional": true
},
"fs-minipass": {
"version": "1.2.5",
"resolved": false,
"resolved": "",
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
"dev": true,
"optional": true,
@@ -6397,14 +6420,14 @@
},
"fs.realpath": {
"version": "1.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true,
"optional": true
},
"gauge": {
"version": "2.7.4",
"resolved": false,
"resolved": "",
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"dev": true,
"optional": true,
@@ -6421,7 +6444,7 @@
},
"glob": {
"version": "7.1.3",
"resolved": false,
"resolved": "",
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"dev": true,
"optional": true,
@@ -6436,14 +6459,14 @@
},
"has-unicode": {
"version": "2.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
"dev": true,
"optional": true
},
"iconv-lite": {
"version": "0.4.24",
"resolved": false,
"resolved": "",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dev": true,
"optional": true,
@@ -6453,7 +6476,7 @@
},
"ignore-walk": {
"version": "3.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
"dev": true,
"optional": true,
@@ -6463,7 +6486,7 @@
},
"inflight": {
"version": "1.0.6",
"resolved": false,
"resolved": "",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"optional": true,
@@ -6474,21 +6497,21 @@
},
"inherits": {
"version": "2.0.3",
"resolved": false,
"resolved": "",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
"resolved": false,
"resolved": "",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true,
"optional": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"optional": true,
@@ -6498,14 +6521,14 @@
},
"isarray": {
"version": "1.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true,
"optional": true
},
"minimatch": {
"version": "3.0.4",
"resolved": false,
"resolved": "",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"optional": true,
@@ -6515,14 +6538,14 @@
},
"minimist": {
"version": "0.0.8",
"resolved": false,
"resolved": "",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"resolved": false,
"resolved": "",
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
"dev": true,
"optional": true,
@@ -6533,7 +6556,7 @@
},
"minizlib": {
"version": "1.2.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
"dev": true,
"optional": true,
@@ -6543,7 +6566,7 @@
},
"mkdirp": {
"version": "0.5.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"optional": true,
@@ -6553,14 +6576,14 @@
},
"ms": {
"version": "2.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"dev": true,
"optional": true
},
"needle": {
"version": "2.3.0",
"resolved": false,
"resolved": "",
"integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
"dev": true,
"optional": true,
@@ -6572,7 +6595,7 @@
},
"node-pre-gyp": {
"version": "0.12.0",
"resolved": false,
"resolved": "",
"integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==",
"dev": true,
"optional": true,
@@ -6591,7 +6614,7 @@
},
"nopt": {
"version": "4.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
"dev": true,
"optional": true,
@@ -6602,14 +6625,14 @@
},
"npm-bundled": {
"version": "1.0.6",
"resolved": false,
"resolved": "",
"integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
"dev": true,
"optional": true
},
"npm-packlist": {
"version": "1.4.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
"dev": true,
"optional": true,
@@ -6620,7 +6643,7 @@
},
"npmlog": {
"version": "4.1.2",
"resolved": false,
"resolved": "",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"dev": true,
"optional": true,
@@ -6633,21 +6656,21 @@
},
"number-is-nan": {
"version": "1.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true,
"optional": true
},
"once": {
"version": "1.4.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"optional": true,
@@ -6657,21 +6680,21 @@
},
"os-homedir": {
"version": "1.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true,
"optional": true
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true,
"optional": true
},
"osenv": {
"version": "0.1.5",
"resolved": false,
"resolved": "",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dev": true,
"optional": true,
@@ -6682,21 +6705,21 @@
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true,
"optional": true
},
"process-nextick-args": {
"version": "2.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true,
"optional": true
},
"rc": {
"version": "1.2.8",
"resolved": false,
"resolved": "",
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"dev": true,
"optional": true,
@@ -6709,7 +6732,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true,
"optional": true
@@ -6718,7 +6741,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": false,
"resolved": "",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"optional": true,
@@ -6734,7 +6757,7 @@
},
"rimraf": {
"version": "2.6.3",
"resolved": false,
"resolved": "",
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
"dev": true,
"optional": true,
@@ -6744,49 +6767,49 @@
},
"safe-buffer": {
"version": "5.1.2",
"resolved": false,
"resolved": "",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
"resolved": false,
"resolved": "",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true,
"optional": true
},
"sax": {
"version": "1.2.4",
"resolved": false,
"resolved": "",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true,
"optional": true
},
"semver": {
"version": "5.7.0",
"resolved": false,
"resolved": "",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
"dev": true,
"optional": true
},
"set-blocking": {
"version": "2.0.0",
"resolved": false,
"resolved": "",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true,
"optional": true
},
"signal-exit": {
"version": "3.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true,
"optional": true
},
"string-width": {
"version": "1.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"optional": true,
@@ -6798,7 +6821,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": false,
"resolved": "",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"optional": true,
@@ -6808,7 +6831,7 @@
},
"strip-ansi": {
"version": "3.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"optional": true,
@@ -6818,14 +6841,14 @@
},
"strip-json-comments": {
"version": "2.0.1",
"resolved": false,
"resolved": "",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"dev": true,
"optional": true
},
"tar": {
"version": "4.4.8",
"resolved": false,
"resolved": "",
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
"dev": true,
"optional": true,
@@ -6841,14 +6864,14 @@
},
"util-deprecate": {
"version": "1.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true,
"optional": true
},
"wide-align": {
"version": "1.1.3",
"resolved": false,
"resolved": "",
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"dev": true,
"optional": true,
@@ -6858,14 +6881,14 @@
},
"wrappy": {
"version": "1.0.2",
"resolved": false,
"resolved": "",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"resolved": false,
"resolved": "",
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
"dev": true,
"optional": true
@@ -10526,6 +10549,11 @@
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
},
"lodash-es": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz",
"integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ=="
},
"lodash._baseisequal": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/lodash._baseisequal/-/lodash._baseisequal-3.0.7.tgz",
+4 -5
View File
@@ -29,9 +29,10 @@
"@types/cheerio": "^0.22.13",
"@types/core-js": "^2.5.2",
"@types/enzyme": "^3.10.4",
"@types/es6-promise": "^3.3.0",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^24.0.20",
"@types/lodash": "^4.14.144",
"@types/lodash-es": "^4.17.3",
"@types/node": "^12.11.7",
"@types/react-redux": "^7.1.5",
"@types/redux-mock-store": "^1.0.1",
@@ -64,7 +65,6 @@
"jest-extended": "^0.11.2",
"jest-localstorage-mock": "^2.4.0",
"lint-staged": "^9.4.2",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.8.0",
"node-fetch": "^2.6.0",
"npm-run-all": "^4.1.5",
@@ -101,17 +101,16 @@
"bem-react-helper": "^1.1.2",
"classnames": "^2.2.6",
"core-js": "^3.2.1",
"es6-promise": "^4.2.8",
"focus-visible": "^5.0.2",
"intersection-observer": "^0.7.0",
"lodash-es": "^4.17.15",
"node-emoji": "^1.10.0",
"preact": "^10.0.1",
"react-redux": "^7.1.1",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
},
"eslintIgnore": [
"public"
],
"engines": {
"node": ">=8"
}
+1 -1
View File
@@ -87,7 +87,7 @@ module.exports = () => ({
{
oneOf: [
{
include: [path.resolve(__dirname, './app/embed.ts')],
include: [path.resolve(__dirname, './app/embed.ts'), path.resolve(__dirname, './app/counter.ts')],
use: {
loader: 'ts-loader',
options: {