Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vendor CSS included twice #397

Open
giulioprovasi opened this issue Aug 4, 2015 · 0 comments
Open

Vendor CSS included twice #397

giulioprovasi opened this issue Aug 4, 2015 · 0 comments

Comments

@giulioprovasi
Copy link

I have the following setup:

vendor_files: {
        js: [
            'vendor/angular/angular.js',
            'vendor/angular-animate/angular-animate.js',
            'vendor/angular-aria/angular-aria.js',
            'vendor/angular-material/angular-material.js',
            'vendor/placeholders/angular-placeholders-0.0.1-SNAPSHOT.min.js',
            'vendor/angular-ui-router/release/angular-ui-router.js',
            'vendor/angular-cookies/angular-cookies.js',
            'vendor/angular-translate/angular-translate.js',
            'vendor/angular-translate-storage-cookie/angular-translate-storage-cookie.js',
            'vendor/angular-translate-storage-local/angular-translate-storage-local.js',
            'vendor/angular-translate-loader-static-files/angular-translate-loader-static-files.js',
        ],
        css: [
            'vendor/angular-material/angular-material.css'
        ],
        assets: []
    }

with my custom CSS.

When using grunt build the Vendor files are both concatenated with the custom generated CSS and directly linked to the webpage.

The problem comes from this function:

   /**
     * A utility function to get all app CSS sources.
     */
    function filterForCSS(files) {
        return files.filter(function (file) {
            return file.match(/\.css$/);
        });
    }

because it match both the compiled file and the vendor css files.

I fixed the problem with this:

   /**
     * A utility function to get all app CSS sources.
     */
    function filterForCSS(files) {
        return files.filter(function (file) {
            return file.match(/build.*\.css$/);
        });
    }

So I link to the index.html only the files that are in "build/" directory, Is this correct in your opinion ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant