Skip to content

Sourcemaps compatibility with postcss-import #153

Closed
@mdmoreau

Description

@mdmoreau

I've been trying to get sourcemaps to work when using postcss-import via postcss-cli, but I can't seem to figure out what's going wrong. Here's my npm script that's handling the task:

postcss src/css/main.css --use postcss-import postcss-mixins postcss-cssnext postcss-clean --output dist/css/main.min.css --map --watch

Everything works correctly except the sources that are set on the external .map file. The start of that file always reads as this:

{
  "version":3,
  "sources":[
    "<input css 1>"
  ],
  "names":[

  ],
  "mappings":"AAAA..."
}

Every time the task runs, the <input css 1> increments by one. Is there some config option that I'm missing? The closest I've gotten it to working is by using the package.json config to set the postcss map from value to match the input file, but then sources all just show main.css (with import statements) instead of the individual files.

Thanks in advance - really appreciate all the work on this tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions