-
Notifications
You must be signed in to change notification settings - Fork 92
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
Is this repo actively maintained? #112
Comments
For my own needs, I was able to replicate the functionality of this library using solely two widely-used libraries, ejs and html-minifier. e.g. code below (typescript) In plugins list: ...
plugins: [
...,
processHtml(true, templateVariables),
] And then the code: function processHtml(shouldMinify: boolean, templateVariables: MyProjectEjsTemplateVariables): PluginOption {
return {
name: 'myproject:processHtml',
enforce: 'pre',
transformIndexHtml: {
enforce: 'pre',
transform(html: string) {
const rendered = ejs.render(html, { ...templateVariables }, { root: __dirname });
return shouldMinify
? minify(
rendered,
// https://github.com/kangax/html-minifier#options-quick-reference
{
collapseWhitespace: true,
removeComments: true,
removeAttributeQuotes: true,
removeScriptTypeAttributes: true,
removeRedundantAttributes: true,
removeTagWhitespace: true,
}
)
: rendered;
},
},
};
} |
If you only need ejs there is this plugin https://github.com/trapcodeio/vite-plugin-ejs |
I'd also love to get an answer to this - we're looking to migrate to Vue 3 and I was under the impression that this package was the standard migration path for projects that used ejs in the entry index.html. It certainly wasn't obvious from the Vue 3 docs though, so it would be helpful to know if that's an incorrect assumption. |
I've found Here's how I'm using it and it is awesome! plugins: [vitePluginVirtualHtml({
pages: {
index: {
entry: './demo/index.js', // MUST
title: `${name} demo`,// optional, default: ''
body: '<div id="app"><div id="demo"></div></div>' // optional, default: '<div id="app"></div>'
}
},
})] |
I also created an alternative. Supports:
I built that to cover my needs in a large project I maintain so rest assured, it won't be abandoned anytime soon :) |
Normally I hate such issues being filed, but they are also a good indicator as to the health of a repo, if someone is considering using a library.
In this case, I've recently tried emailing the maintainer(s) and gotten no response, as well as observed a bunch of stale issues.
Does the maintainer need help? Should this repo be forked?
The text was updated successfully, but these errors were encountered: