diff --git a/src/core/components/app.jsx b/src/core/components/app.jsx index 9ef5a8fd..e701ba06 100644 --- a/src/core/components/app.jsx +++ b/src/core/components/app.jsx @@ -1,6 +1,16 @@ import React from "react" import PropTypes from "prop-types" +let Perf = null +let ReactPerfTool = null +if (process.env.NODE_ENV !== "production") { + Perf = require("react-addons-perf") + window.Perf = Perf + + ReactPerfTool = require("react-perf-tool") + require("react-perf-tool/lib/styles.css") +} + export default class App extends React.Component { getLayout() { @@ -14,7 +24,10 @@ export default class App extends React.Component { const Layout = this.getLayout() return ( - +
+ + +
) } } diff --git a/src/core/index.js b/src/core/index.js index 9d9c0ac3..3dbcede4 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -6,11 +6,6 @@ import ApisPreset from "core/presets/apis" import * as AllPlugins from "core/plugins/all" import { parseSearch } from "core/utils" -if (process.env.NODE_ENV !== "production") { - const Perf = require("react-addons-perf") - window.Perf = Perf -} - // eslint-disable-next-line no-undef const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, HOSTNAME, BUILD_TIME } = buildInfo