chore: fix type problem and add npm script for analysis

pull/81/head
moonrailgun 4 years ago
parent 2c6a359983
commit f339302203

@ -7,6 +7,7 @@ import { parse, stringify } from 'flatted';
import _get from 'lodash/get';
import _isEqual from 'lodash/isEqual';
import { useEffect, useRef } from 'react';
import { isDevelopment } from '../utils/environment';
interface UseWhyDidYouUpdateCallback<T> {
onChangeFound?: (data: {
@ -49,7 +50,7 @@ export function useWhyDidYouUpdate<T>(
const latestProps = useRef(props);
useEffect(() => {
if (!__DEV__) return;
if (!isDevelopment) return;
const allKeys = Object.keys({ ...latestProps.current, ...props });

@ -10,6 +10,7 @@
"build": "yarn plugins:all && cross-env TS_NODE_PROJECT='tsconfig.node.json' webpack --config ./build/webpack.config.ts",
"dev": "cross-env TS_NODE_PROJECT='tsconfig.node.json' NODE_ENV=development webpack serve --config ./build/webpack.config.ts",
"serve": "npx http-server ./dist",
"analysis": "cross-env ANALYSIS=true yarn build",
"check:type": "tsc --noEmit --skipLibCheck",
"postinstall": "yarn plugins:install",
"plugins:new": "ministar createPlugin",

Loading…
Cancel
Save