giuseppeg / styled-jsx-postcss

Use PostCSS with styled-jsx 💥
MIT License
64 stars 11 forks source link

remove postcss comments #14

Open timsuchanek opened 7 years ago

timsuchanek commented 7 years ago

When using plugins like postcss-next, postcss-inherit it occurs to me, that the sourcemap is added, even in production builds. This removes the comments completely. It reduced our build size from 9.8M to 5.2M

giuseppeg commented 7 years ago

Maybe we should make this behavior configurable. We could pass postcss options to the processor from the babel plugin https://github.com/giuseppeg/styled-jsx-postcss/blob/master/src/babel.js#L91 https://babeljs.io/docs/plugins/#plugin-preset-options

comerc commented 7 years ago

My .postcssrc.js

module.exports = context => ({
  plugins: {
    'postcss-discard-comments': { removeAll: true },
    'postcss-inline-comment': {},
    'postcss-cssnext': {},
  },
})