3 years ago

Gulp --production breaks urls

Posted 3 years ago by RickL


I have an issue regarding minifying CSS files using Gulp in Laravel.

During the production process of my project I have used Gulp without any issues to convert scss files to css files and mix these css files into one file. All very simple.

Now the project is lauched, I minified everything using the gulp --production command. But it breaks the urls I have set in my scss-files and I can't figure out why. When I leave "--production" out, everything works perfectly again.

For example, I use the following in my SCSS-file:

#cta { background: #cececeurl(../../assets/images/cta2/cta2-bg.jpg) no-repeat 50% 50%; }

In the minified CSS it is translated to:

#cta { background:url(../images/cta2/cta2-bg.jpg) 50% 50% no-repeat #cecece; }

As you can see, it is a different url here, and that's why all of my background images are broken.

Does anyone have any idea how this can happen, and how to solve this?

Thanks you very much in advance! Rick

Please sign in or create an account to participate in this conversation.