Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support relative path for base, such as '../' #13186

Closed
4 tasks done
Xli33 opened this issue May 13, 2023 · 1 comment
Closed
4 tasks done

Please support relative path for base, such as '../' #13186

Xli33 opened this issue May 13, 2023 · 1 comment

Comments

@Xli33
Copy link

Xli33 commented May 13, 2023

Description

this's the minimum vite config needed

export default defineConfig(({ command, mode }) => {
  return {
     base: '../'
  }
})

but the relative path is not allowed by vite and it warns
(!) invalid "base" option: ../. The value can only be an absolute URL, ./, or an empty string.

and we could not limit the base to '/some-directory/' in fact, so the '../' is the only solution, however, which vite doesn't support for now
o(╥﹏╥)o

Suggested solution

support relative path for base url

Alternative

No response

Additional context

No response

Validations

@fi3ework
Copy link
Member

You could try the experimental https://vitejs.dev/guide/build.html#advanced-base-options which provides a fine-grained control on URL. base only supports common usage so far. Simple example:

  experimental: {
    renderBuiltUrl: (filename) => {
      return `../${filename}`;
    },
  },

@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants