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.

.minify() method does not allow mix.options for CSS files

See original GitHub issue
  • Laravel Mix Version: 0.11.2
  • Node Version: 6.9.3
  • NPM Version: 3.10.10

Description:

.minify() method does not allow to pass mix.options for CSS files.

In some scenarios I just want cleanCss to inline the CSS and to not rebase URLs. Here is how we can pass additional options:

// src/File.js
minify() {
    minify() {
        if (this.fileType === '.js') {
            this.write(uglify.minify(this.file, options.uglify).code);
        }

        // From Mix options configuration
        options.cleanCss = {
            level: 0,
            rebase: false
        };

        if (this.fileType === '.css') {
            this.write(
                new UglifyCss(options.cleanCss).minify(this.read()).styles
            );
        }
    }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ruchernchongcommented, May 3, 2017

@rsdev000 Yeah, I am having the same issue as you #760

0reactions
rjsworkingcommented, May 3, 2017

You have the expected result. Same laravel-mix here, cleancss 4.0.12, npm 6.5.0, node 6.10.3. There’s must be another issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

minify() method does not allow mix.options for CSS files #735
Description: .minify() method does not allow to pass mix.options for CSS files. In some scenarios I just want cleanCss to inline the CSS...
Read more >
Minification issues: theme & minify css file both loaded
I have set up w3tc on our website. I ran a test through pingdom and noticed that two large css files were being...
Read more >
Combine and Minify Multiple CSS / JS Files - Stack Overflow
Show activity on this post. Check out minify - it allows you combine multiple js, css files into one just by stacking them...
Read more >
Minify CSS - web.dev
Learn how to minify CSS files, to improve performance, without affecting how the browser process the styles.
Read more >
The complete best practices for minifying CSS - LogRocket Blog
Minifying CSS files is more nuanced than you might think at first. Learn the various minification tools, how to determine and remove unused ......
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