Giter Site home page Giter Site logo

Comments (13)

TrySound avatar TrySound commented on August 11, 2024

@htanjo Which plugins need this option?

from gulp-postcss.

htanjo avatar htanjo commented on August 11, 2024

In my project, postcss-copy-assets requires it.
And I tried postcss-copy previously, it also depends on to option.

from gulp-postcss.

w0rm avatar w0rm commented on August 11, 2024

@htanjo sorry for the delay, I'm extremely busy this week, will be able to check it over the Weekend.

from gulp-postcss.

htanjo avatar htanjo commented on August 11, 2024

@w0rm That's ok! Thanks.

from gulp-postcss.

w0rm avatar w0rm commented on August 11, 2024

@htanjo I sent you a temporary fix that should work.

Sourcemaps are really complicated in gulp. The source map from the previous operation has to be combined with the sourcemap from the next operation. This only works when file from the previous map matches element from sources of the current map.

This is what was happening when the to='dist/main.css' option was set:

previousMap = {sources: [ 'main.scss' ], file: 'main.css'}
currentMap = {sources: [ '../src/main.css' ], file: 'main.css'}

Because main.css and ../src/main.css do not match, only the currentMap was output.

The additional complication comes from the base option of the gulp file, gulp source maps work relatively to the base directory, but postcss doesn't have this separation.

from gulp-postcss.

w0rm avatar w0rm commented on August 11, 2024

It seems that I can only properly fix this issue after this is implemented in postcss: postcss/postcss#240

from gulp-postcss.

htanjo avatar htanjo commented on August 11, 2024

@w0rm I see...! I understood the situation.
Your workaround is very helpful and I'll use it at the moment.
Thanks!

from gulp-postcss.

alvint avatar alvint commented on August 11, 2024

I get the same issue regardless of the to option. In fact, even if I run postcss with an empty processor list and no options I have this problem. The issue is also affecting plugins which rely on postcss, such as gulp-autoprefixer.

from gulp-postcss.

w0rm avatar w0rm commented on August 11, 2024

@alvint hi, if it happens regardless of the to option then it's not related to this issue. Please open a separate issue and add a link to a minimal project that reproduces it. This way I will be able to help you.

Sometimes gulp-postcss is not even an issue. A previous gulp plugin may generate a wrong source map that cannot be merged, so I really need to see the code to figure out what went wrong!

from gulp-postcss.

alexander-akait avatar alexander-akait commented on August 11, 2024

Some issue, I try to understand in detail what the problem is

from gulp-postcss.

timkraut avatar timkraut commented on August 11, 2024

Any updates on that?

from gulp-postcss.

w0rm avatar w0rm commented on August 11, 2024

@timkraut nope and postcss/postcss#240 wasn't implemented.

from gulp-postcss.

w0rm avatar w0rm commented on August 11, 2024

Closing as wontfix because postcss/postcss#240 is closed.

from gulp-postcss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.