question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no versioning for css files

See original GitHub issue

webpack.mix.js:

mix.js('resources/assets/js/pages/main.js', 'public/js/main.js')
    .js('resources/assets/js/pages/account.js', 'public/js')
    .sass('resources/assets/sass/pages/main.scss', 'public/css')
    .sourceMaps()
    .combine([
        'resources/assets/uikit/css/uikit-edit.css',
        'resources/assets/uikit/css/components/upload.gradient.css',
        'resources/assets/uikit/css/components/sticky.gradient.css',
        'node_modules/sweetalert/dist/sweetalert.css',
        'resources/assets/css/animate.css',
        'resources/assets/css/app.css'
    ], 'public/css/all.css')
    .version();

public/css/all.css does not get versioned. Only .js and .sass

pic2

manifest:

{
  "/js/account.js": "/js/account.ea71c09548b7227cbe14.js",
  "/js/main.js": "/js/main.8876eb3f57f68f278c2c.js",
  "/css/main.css": "/css/main.3f8e8514365bea403da7.css"
}

on Win 10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
adriaanzoncommented, Jan 30, 2017

Yeah, you can’t pass an array to mix.sass(), only one file. So you’d have to use one sass file that imports the css files, something like this:

// webpack.mix.js

mix.sass('resources/assets/sass/app.scss', 'public/css/all.css');
// resources/assets/sass/app.scss

@import "../uikit/css/uikit-edit.css";
@import "../uikit/css/components/upload.gradient.css";
@import "node_modules/sweetalert/dist/sweetalert.css";
// etc.
4reactions
nejtr0ncommented, Feb 1, 2017

So, it’s not compataible with elixir version on styles

        //Concat all scripts in one
        .scripts(
            modules
                .map(function(module) {
                    return module.paths.admin_js;
                })
                .filter(filter_assets)
            , 'public/js/admin/all.js')
        .version([
            'public/css/admin/all.css',
            'public/js/admin/all.js'
        ])

Please return elixr!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Versioning CSS files to invalidate browser cache
CSS versioning is a trick used to make the browser notice the change on your CSS file and request a new CSS file...
Read more >
Why adding version number to CSS file path?
One of the reason could be to bypass file caching. Same name CSS files can be cached by the servers and may result...
Read more >
How to add versioning to your CSS and jQuery and avoid ...
Another way to ensure that the User Experience is optimised is to add versioning to your CSS and jQuery files, therefore forcing the...
Read more >
Auto-Versioning JavaScript and CSS Files in PHP
This method aims at harnessing the modification time of a JavaScript or CSS file to implement auto-versioning. The idea is to automatically ...
Read more >
no versioning for css files · Issue #211 · laravel-mix/ ...
The problem is that css files generated from sass compilation are versioned, so they have a different name from original, just use wildcard...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found