Skip to content
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

Rendered html not minified #108

Open
yusupprog opened this issue Jun 13, 2019 · 1 comment
Open

Rendered html not minified #108

yusupprog opened this issue Jun 13, 2019 · 1 comment

Comments

@yusupprog
Copy link

yusupprog commented Jun 13, 2019

Rendered html not minified. Only vue-cli portion is minified, ssr plugin html and css are send unminified. Can anyone help with this?

Screen Shot 2019-06-13 at 21 29 21

@PureDizzi
Copy link

PureDizzi commented Jul 31, 2019

Found a solution.

Within node_modules\@akryum\vue-cli-plugin-ssr

npm i html-minifier

Edit node_modules\@akyrum\vue-cli-plugin-ssr\lib\app.js

Include at the top

const minify = require('html-minifier').minify

I changed

res.status(context.httpCode).send(html)

to

res.status(context.httpCode).send(minify(html, {
  collapseWhitespace: true,
  minifyCSS: true,
  minifyJS: true,
}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants