Replies: 1 comment 1 reply
-
const baseUrl = (process.env.VUEPRESS_BASE_URL as `/${string}/`) || '/' |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
brpaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. I have created my
vuepress.config.ts
, since all the request of the project is typescript, but I am having an issue with the type definitions for thebase
property.I want it to be dynamic, so I am reading from an environment variable like this:
It works, but breaks type checking because the
base
property as a very strict type of/ || /${string}/
Any way to get around this? Otherwise, I think it would be better to make the type less strict, and be a simple
string
. I think it´s overkill the way it is defined now.Beta Was this translation helpful? Give feedback.
All reactions