SassNinja / postcss-extract-media-query

PostCSS plugin to extract all media query from CSS and emit as separate files.
MIT License
130 stars 20 forks source link

File naming gets confused if source file names have more than one dot in them #8

Closed jono-hayward closed 5 years ago

jono-hayward commented 5 years ago

I've found that if my input files have more than one dot, the output file name is mixed up.

This is my config:

{
  output: {
    path: './theme/assets/',
    name: '[name]--[query].[ext]',
  },
  queries: {
    'prefers-reduced-motion: reduce': 'nomotion',
    'all and (-ms-high-contrast: none), (-ms-high-contrast: active)': 'ie'
  },
  whitelist: true
}

If either of those queries are triggered on the file _components.order-form.css, the resulting file name is _components--ie.order-form (notice the file extension is missing). The output I'm expecting here would be _components.order-form--ie.css.

SassNinja commented 5 years ago

Hi @jono-hayward

thanks for the bug report!

Seems my filename regex doesn't consider multiple dots but expects [name without dots].[ext]

I'll fix this when I've got some time.