-
|
Hello, I am trying to achieve the replacement of string To do so, I put the following in const trimTrailingSlash = (str) => str.replace(/\/+$/g, '');
const transformHtmlPlugin = () => ({
name: 'transform-html',
transformIndexHtml: {
order: 'pre',
handler(html) {
return html.replace(
/<%=\s*(\w+)\s*%>/gi,
(match, p1) => data[p1] || ''
);
}
}
});
export default {
root: 'src/',
publicDir: '../static/',
base: './my_base_path/',
build:
{
outDir: '../dist',
emptyOutDir: true,
sourcemap: true,
rollupOptions: {
input: {
main: resolve(__dirname, 'src/index.html'),
create: resolve(__dirname, 'src/create.html')
}
}
},
plugins:
[
transformHtmlPlugin({ base_url_no_trailing_slash: trimTrailingSlash(base) }),
]
}However as such, the plugin won't work. |
Beta Was this translation helpful? Give feedback.
Answered by
oleole39
Feb 13, 2026
Replies: 1 comment
-
|
that was more of a JS issue, although I already don't remember what exactly. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
oleole39
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
that was more of a JS issue, although I already don't remember what exactly.