UsmanA
UsmanA

Reputation: 61

HTML files not added to compiled folder when run 'Grunt' - Yeoman scaffold

I used Yeoman to scaffold my site. I want to use jade templates which so far is half working, my jade files go to the tmp as html files folder and livereload is displaying this fine, but when I run grunt to build my site the html files from folder .tmp do not get placed into my public_html folder. All other folders/assets as expected are going to public_html.

Here is my folder structure apologies for the bad illustration:

Upvotes: 5

Views: 370

Answers (2)

aqm
aqm

Reputation: 3034

Think your issue is in your htmlmin task

htmlmin: {
    public_html: {
        options: {
            /*removeCommentsFromCDATA: true,
            // https://github.com/murata/grunt-usemin/issues/44
            //collapseWhitespace: true,
            collapseBooleanAttributes: true,
            removeAttributeQuotes: true,
            removeRedundantAttributes: true,
            useShortDoctype: true,
            removeEmptyAttributes: true,
            removeOptionalTags: true*/
        },
        files: [{
            expand: true,
            cwd: '.tmp',
            src: '*.html',
            dest: '<%= site_name.public_html %>'
        }]
    }
},

needs / at end of '<%= site_name.public_html %>' eg

dest: '<%= site_name.public_html %>/'

maybe ?

Upvotes: 0

Stephen Henderson
Stephen Henderson

Reputation: 2711

What happens when you run grunt htmlmin?

I'm thinking that the htmlmin task isn't running, for some reason. Perhaps it's not running because of the concurrent task, as in this other SO answer:

Notice that in your gruntfile, the htmlmin declaration copies html files from .tmp into <%= site_name.public_html %>.

You might also try grunt build --force to make grunt continue through any errors that may be preventing grunt from eventually running htmlmin.

Upvotes: 0

Related Questions