Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mands/hbs-html-minifier

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mands/hbs-html-minifier

## Desciption This is a Webpack plugin for Handlebars and HTML file minification. `express-minify-html` plugin is adding about 100ms overhead to run-time and affected site speed.

  • 1.0.0
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

hbs-html-minifier

Desciption

This is a Webpack plugin for Handlebars and HTML file minification. express-minify-html plugin is adding about 100ms overhead to run-time and affected site speed.

hbs-html-minifier is substitusion for express-minify-html. After Webpack build, hbs-html-minifier removes white spaces for hbs files and transfer to new directory. It minifies files during the build, so there is no impact on run-time.

Getting Started

Installation

  • Run npm install hbs-html-minifier --save-dev

Configuring

Import in your webpack.config.js file.
<!-- import on the top of the file -->
const HandleberMinifyPlugin = require('hbs-html-minifier');
Add imported plugin to plugins: as following.
plugins: [
  new HandleberMinifyPlugin([
    {
      page: 'l'  // foldername for each page (ex. fesk-plp => 'l', fesk-home-page => 'hp' etc.)
    }
  ])
]
This plugin transfers minified .hbs files to new directory, so changing server.js.
  1. Setting new views.

    • server.set('views', './l/hbs/src/server/views/pages'); // This example is setting for 'fesk-plp'
  2. Setting new partialDir for partials and npm_modules.

    // This is an example for fesk-plp
    partialsDir: [
        'l/hbs/src/server/views/partials',
        'l/hbs/src/server/views/partials/layouts',
        'l/hbs/src/server/views/partials/pagination',
        {
            dir: 'l/hbs/mns-core-ui-header/templates/header/partials',
            namespace: 'templates/header/partials'
        },
        {
            dir: 'l/hbs/mns-fe-patterns',
            namespace: 'mns-fe-patterns'
        }
    ]

FAQs

Package last updated on 18 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc