styled-jsx-postcss icon indicating copy to clipboard operation
styled-jsx-postcss copied to clipboard

remove postcss comments

Open timsuchanek opened this issue 7 years ago • 2 comments

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

timsuchanek avatar Mar 31 '17 14:03 timsuchanek

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

giuseppeg avatar Apr 23 '17 11:04 giuseppeg

My .postcssrc.js

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

comerc avatar May 27 '17 12:05 comerc