How to use the umi-plugin-react.default function in umi-plugin-react

To help you get started, we’ve selected a few umi-plugin-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alitajs / alita / packages / alita / src / plugins / index.ts View on Github external
.use('eslint-loader')
        .loader(require.resolve('eslint-loader'))
        .options(eslintOptions);
    });
  }

  function getId(id) {
    return `alita:${id}`;
  }

  function noop() {
    return true;
  }
  const reactPlugin = require('umi-plugin-react').default;

  reactPlugin(api, opts.umi);

  const registerConfigArr = ['retainLog', 'appType', 'umi', 'tongjiCode', 'gaCode', 'mainPath', 'complexRoute', 'keepalive'];
  registerConfigArr.forEach(item => {
    api._registerConfig(() => {
      return () => {
        return {
          name: item,
          validate: noop,
          onChange(newConfig) {
            api.restart(`${item} change`);
          },
        };
      };
    });
  })

umi-plugin-react

React plugin set for umi.

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages