Giter Site home page Giter Site logo

html-minifier-loader's Introduction

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
}

html-minifier-loader's People

Contributors

acupofspirt avatar boopathi avatar den-dp avatar sapics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

html-minifier-loader's Issues

Any-Version on npm

Is it possible to install the any-version as a dependency? Is it on NPM?

Deprecated version of the loader-utils package

Hi guys. First of all thanks for the useful package
When i update my webpack to version 2.2.1 i got deprecation warning:

[13:58:24] Starting 'webpack'...
(node:22879) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
    at Object.parseQuery (/home/max/work/kipod-x/station/ui/node_modules/loader-utils/index.js:78:3)
    at Object.module.exports (/home/max/work/kipod-x/station/ui/node_modules/html-minifier-loader/index.js:13:28)
    at LOADER_EXECUTION (/home/max/work/kipod-x/station/ui/node_modules/loader-runner/lib/LoaderRunner.js:119:14)
    at runSyncOrAsync (/home/max/work/kipod-x/station/ui/node_modules/loader-runner/lib/LoaderRunner.js:120:4)
    at iterateNormalLoaders (/home/max/work/kipod-x/station/ui/node_modules/loader-runner/lib/LoaderRunner.js:229:2)
    at Array.<anonymous> (/home/max/work/kipod-x/station/ui/node_modules/loader-runner/lib/LoaderRunner.js:202:4)
    at Storage.finished (/home/max/work/kipod-x/station/ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:15)
    at /home/max/work/kipod-x/station/ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:69:9
    at /home/max/work/kipod-x/station/ui/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:416:3)

As i understand you need update loader-utils package and use it new API
Details here webpack/loader-utils#56

Parse Error on some special characters such as <>

Hi! Looks like html-minifier-loader (or its internals) breaks on html like this

<span>User name contains bad characters like: !$&*()|?/<>\'`"%</span>
Module build failed: Error: Parse Error: <>\'`"%</span>

I know about &lt; and &amp; but to my knowledge the code above is valid.

And my question is where should I address with this problem?

Thanks

Peer Dependency requires adding html-minifier explicitly to package.json

You made a change on 9/2/2016 that moved html-minifier to a peerDependency. For consumers using npm version 3+ this means html-minifier will not be installed automatically. We have to add it explicitly to our own package.json in order to use html-minifier-loader.

You might want to update the readme.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.