Skip to content

sapics/html-minifier-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-minifier-loader NPM version

Webpack loader that minifies HTML by html-minifier.

Installation

npm install html-minifier html-minifier-loader --save

Example of webpack.config.js

You can pass html-minifier parameters by 'html-minifier-loader' property. The default is {removeComments: true, collapseWhitespace: true}.

module: {
    loaders: [
        {    test: /\.html$/,
             loader: 'raw-loader!html-minifier-loader'
        }
    ]
},
'html-minifier-loader': {
    removeComments: false,
    collapseWhitespace: true,
    conservativeCollapse: true,
    preserveLineBreaks: true
}

About

Webpack loader which minifies HTML by html-minifier

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published