fraserxu / gulp-html2js

Gulp plugin for converting AngularJS templates to JavaScript
https://github.com/fraserxu/gulp-html2js
MIT License
38 stars 25 forks source link

Anyway to use the htmlmin option? #23

Open dander401 opened 8 years ago

dander401 commented 8 years ago

I have the following task

    return gulp.src( [
            webRoot + '**/*.html'
        ] )
        .pipe( $.debug( {
            title: 'localTemplates'
        } ) )
        .pipe( $.html2js( 'templates.js', {      //not sure what temp
            adapter: 'angular',
            base: 'src/main/static/templates',
            name: 'dander',
            htmlmin: {
                collapseBooleanAttributes: true,
                collapseWhitespace: true,
                removeAttributeQuotes: true,
                removeComments: true,
                removeEmptyAttributes: true,
                removeRedundantAttributes: true,
                removeScriptTypeAttributes: true,
                removeStyleLinkTypeAttributes: true
            }
        } ) )
        .pipe( gulp.dest( distRoot + '/templates' ) );

After the task runs, the html is unchanged. Am I doing something wrong?

jeserkin commented 8 years ago

This isn't grunt. Create task for htmlmin and html2js and set, that html2js depends/requires htmlmin task to run thirst or other way around. How you need.