Skip to content

How to config differnet baseURLs for different input files? #1611

Answered by vlkpa
leslie555 asked this question in Q&A
Discussion options

You must be logged in to vote

it should be part of output

const generateConfig = (target: string) => {
  return {
    output: {
      mode: 'split' as const,
      workspace: 'src/',
      target,
      indexFiles: false,
      mock: false,
      headers: false,
      baseUrl: 'https://yourbackend.url/v1', // <---- your url
      override: {
        mutator: {
          path: './utils/request.ts',
          name: 'request',
        },
      },
    },
    hooks: {
      afterAllFilesWrite: 'prettier --write',
    },
  };
};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by melloware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
workaround A workaround has been provided
2 participants