storybookjs / addon-postcss

This Storybook addon can be used to run the PostCSS preprocessor against your stories.
MIT License
20 stars 22 forks source link

Refactor webpack rule test to support 'postcss' as a lang/file-extension #40

Open enjibby opened 1 year ago

enjibby commented 1 year ago

Laravel Mix and VSCode's Vetur plugin are quite at odds with how to specify that you wish to use PostCSS in your VueJS single-file component. I have used some custom configuration in my project to support <style lang="postcss"> for my NPM builds, but Storybook (in particular, this postcss addon) does not yet recognise this customisation.

I have updated the css rule test to allow a developer to specify <style lang="postcss"> in their single-file components to ensure Vetur and linting tools correctly recognise the code, while still supporting the same compilation when using the default <style> element.