0.0.6 • Published 9 years ago

gulp-minify-inline-scripts v0.0.6

Weekly downloads
101
License
MIT
Repository
github
Last release
9 years ago

gulp-minify-inline-scripts

a plugin for gulp.js to minify inline scripts in html files

Installation

npm install gulp-minify-inline-scripts

Usage

var minifyInline = require('gulp-minify-inline-scripts');

gulp.task('minify', function() {
    gulp.src('html/*.html')
        .pipe(minifyInline())
        .pipe(gulp.dest('dist'))
});

Example

before: index.html

<html lang="en">
<head>
<meta charset="utf-8"/>
<title></title>
</head>
<body>
    <input type="button" id="btn" value="click Me" />

    <script type="text/javascript">
        var btn = document.querySelector("#btn");

        btn.onclick = function() {
            this.style.background = ["yellow","red","green","purple","pink","gray","blue","orange","black","cyan"][Math.floor(Math.random() * 10)];
        };

        setInterval(function() {
            console.log(btn.style.background);
        },1000)

    </script>
</body>
</html>

after:index.html

<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title></title>
</head>
<body>
    <input type="button" id="btn" value="click Me" />

    <script type="text/javascript">var btn=document.querySelector("#btn");btn.onclick=function(){this.style.background=["yellow","red","green","purple","pink","gray","blue","orange","black","cyan"][Math.floor(10*Math.random())]},setInterval(function(){console.log(btn.style.background)},1e3);</script>
</body>
</html>
0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago