postcss / postcss-cli

CLI for postcss
Other
840 stars 93 forks source link

Having a `.css` in the directory path breaks external source map paths #283

Closed bcomnes closed 5 years ago

bcomnes commented 5 years ago

Just ran into a head scratcher: if you are working in a directory path that contains a .css in it, source maps are created in the wrong location.

postcss.config.js

module.exports = (ctx) => ({
  map: { inline: false }
})

Working directory: /foo/bar/baz.css/

Command: postcss ./index.css -o ./dist/site.css

Creates /foo/bar/baz.css/dist/site.css and /foo/bar/baz.css.map/dist/site.css (except this is the source map)

I would expect the following files to be created instead:

/foo/bar/baz.css/dist/site.css /foo/bar/baz.css/dist/site.css.map

RyanZim commented 5 years ago

Yeah, that's a bug. PR welcome to fix it.

bcomnes commented 5 years ago

I’ll try to take a look soonish.