Skip to content

Vendor Styles 404ing #29

@HughxDev

Description

@HughxDev

Per the Gruntfile, all of the vendor CSS files are concatenated into the main stylesheet:

build_css: {
    src: [
        '<%= vendor_files.css %>',
        '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
    ],
    dest: '<%= build_dir %>/assets/<%= pkg.name %>-<%= pkg.version %>.css'
},

Yet, index.html still includes them all individually:

<!-- compiled CSS --><% styles.forEach( function ( file ) { %>
<link rel="stylesheet" type="text/css" href="<%= file %>" /><% }); %>

This results in <link>s pointing to the vendor CSS files' original locations, but they are not actually outputted there.

I thought merely commenting out the forEach block would solve this, but that gets rid of every CSS file, and I just end up with a blank page. Swapping it out for the last element in the styles array, which points to the compiled vendor/app CSS, fixes it (type="text/css" removed because it is redundant with a properly configured MIME type and discouraged in HTML5):

    <link rel="stylesheet" href="<%= styles.pop() %>" />

It could also be solved by modifying the Gruntfile, but I couldn't use arrays in the ways I expected to there for some reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions