How to use the umi-utils.deprecate function in umi-utils

To help you get started, we’ve selected a few umi-utils 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 umijs / umi / packages / umi-build-dev / src / Service.js View on Github external
init() {
    // load env
    this.loadEnv();

    // init plugins
    this.initPlugins();

    // reload user config
    const userConfig = new UserConfig(this);
    const config = userConfig.getConfig({ force: true });
    mergeConfig(this.config, config);
    this.userConfig = userConfig;
    if (config.browserslist) {
      deprecate('config.browserslist', 'use config.targets instead');
    }
    debug('got user config');
    debug(this.config);

    // assign user's outputPath config to paths object
    if (config.outputPath) {
      const { paths } = this;
      paths.outputPath = config.outputPath;
      paths.absOutputPath = join(paths.cwd, config.outputPath);
    }
    debug('got paths');
    debug(this.paths);
  }
github umijs / umi / packages / umi-build-dev / src / routes / patchRoutes.js View on Github external
}

  // /path -> /path.html
  if (route.path && config.exportStatic && config.exportStatic.htmlSuffix) {
    route.path = addHtmlSuffix(route.path, !!route.routes);
  }

  // 权限路由
  // TODO: use config from config.routes
  if (config.pages && config.pages[route.path] && config.pages[route.path].Route) {
    route.Route = config.pages[route.path].Route;
  }

  // Compatible the meta.Route and warn deprecated
  if (route.meta && route.meta.Route) {
    deprecate('route.meta.Route', 'use route.Route instead');
    route.Route = route.meta.Route;
    delete route.meta;
  }

  if (onPatchRoute) onPatchRoute(route);
  if (route.routes) {
    patchRoutes(route.routes, config, isProduction, onPatchRoute);
  }
}