Skip to content

Source mapping is lost #17

@vphantom

Description

@vphantom

Hello,

Right now, I'm running postcss first, then clean-css-cli on its result, and using a map file which inlines sources, I manage to trace which files/lines each rule comes from in Chrome dev tools.

For sake of cleanliness though, I tried postcss-clean to see if I could make these 2 steps into a single one. Unfortunately I can't, which I thought you might like to know. Here's what my postcss.config.js looks like at the moment:

module.exports = {
  map: {
    inline: false,
    sourcesContent: true
  },
  plugins: [
    require('postcss-import')({
      path: [
        './css/',
        './fontello/css/'
      ]
    }),
    require('postcss-assets')({}),
    require('autoprefixer')({}),
    require('postcss-image-inliner')({}),
    require('postcss-clean')({
      rebase: false,
      sourceMapInlineSources: true,
      processImport: false
    })
  ]
};

This is the best I can do: the map file contains the CSS it refers to, but it always contains exactly one single source called <input css 1>. No original file names. Disabling postcss-clean restores proper behavior, so it is really at this stage that references to original files are lost.

So for now I'm back to using the two steps, but it'd be neat if we could eventually figure out why this plugin mangles source references.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions