Closed eight04 closed 2 years ago
The server prefix is added to all output files including the components, css, and html.
Something I have considered is allowing a customPrefix defined at the route level and adjusting how the prefix works in the wrapPremalinkFn.ts
.
Another option is allowing a request
object to have a permalink
defined during a route's all
function. This would bypass the use of the permalink
function for the route.
The drawback to both of these is they undermine the usage of helpers.permalinks[routeName]
in the templates which is something we use heavily and I can see lots of users using as well.
Open to continue this discussion. As I know some people have had issues hosting on gitlab due to this pattern of using the prefix on all files emitted.
Currently I use a buildComplete
hook moving files under ${distDir}/${prefix}
back to distDir
:
https://github.com/eight04/fancy-t-spin/blob/e1a4085cc7ec608825ebfb9fe801b6f026d35feb/src/hooks.js#L27-L39
I want to build
index.html
asdocs/index.html
, while mounting the page in a subfolder.If I set
prefix
tofancy-t-spin
, the path will be resolved correctly:However,
index.html
will be built intodocs/fancy-t-spin/index.html
.In https://github.com/Elderjs/elderjs/pull/128/files, it seems that there is a variable
$$internal.serverPrefix
but defining it inelder.config.js
has no effect.