Skip to content

How to serve static assets from a relative path #13141

Answered by einarq
einarq asked this question in Q&A
Discussion options

You must be logged in to vote

My bad, I had the "base" option under build, seems it needs to be on the top level.

This works:

export default defineConfig(({isSsrBuild}) => ({
  base: "/home/static/",
  build: {
    rollupOptions: isSsrBuild ? serverRollupOptions : undefined,
    cssMinify: true,
    ssr: false,
  },
  plugins: [reactRouter(), tsconfigPaths()],
}));

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@einarq
Comment options

@einarq
Comment options

Comment options

You must be logged in to vote
1 reply
@einarq
Comment options

Comment options

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