gucong3000 / postcss-styled

PostCSS syntax for parsing styled components
MIT License
55 stars 3 forks source link

请问如何在webpack中配置 #41

Open mushan0x0 opened 5 years ago

mushan0x0 commented 5 years ago

我是这样配置的:

[{
  test: /\.(js|mjs|jsx|ts|tsx)$/,
  loader: require.resolve('babel-loader'),
}, {
  loader: require.resolve('postcss-loader'),
  options: {
    syntax: require.resolve('postcss-styled'),
    plugins: [
      require('postcss-px-to-viewport')({
        viewportWidth: 750,
      }),
    ],
  },
}]

我希望在tsx文件中使用styled时将px单位装换成vw单位,但是没有效果