Closed hqylss111 closed 3 years ago
配置如下: import { defineConfig } from 'umi';
export default defineConfig({ nodeModulesTransform: { type: 'none', }, routes: [ { path: '/', component: '@/pages/index' }, ], fastRefresh: {}, publicPath: '/', plugins: [ ['umi-plugin-apollo', {/ uri: 'https://my.endpoint.com/graphql', mock: true, hooksImportFrom: 'react-apollo-hooks', options: 'path/to/options/file', /}], ] });
umi-plugin-apollo 是 umi 2 的插件,不适用于 umi 3。
配置如下: import { defineConfig } from 'umi';
export default defineConfig({ nodeModulesTransform: { type: 'none', }, routes: [ { path: '/', component: '@/pages/index' }, ], fastRefresh: {}, publicPath: '/', plugins: [ ['umi-plugin-apollo', {/ uri: 'https://my.endpoint.com/graphql', mock: true, hooksImportFrom: 'react-apollo-hooks', options: 'path/to/options/file', /}], ] });