7rulnik / postcss-flexibility

PostCSS plugin for Flexibility polyfill
MIT License
296 stars 14 forks source link

Fix: PostCSS plugin not recognised when loading under Laravel Mix #146

Open Nikschavan opened 2 years ago

Nikschavan commented 2 years ago

Fixes #145

7rulnik commented 2 years ago

@Nikschavan hi! I'm looking into changes and it's not clear to me what did you change.

Nikschavan commented 2 years ago

I actually ran npm run lint and fixed it's changes as well (I saw that was being run into travis) If lint changes are excluded this is how the diff would look like -

-const postcssFlexibility = () => ({
+module.exports = () => {
+   return {
    postcssPlugin: 'postcss-flexibility',
    Once(root) {
        root.walkRules(rule => {
@@ -15,8 +16,7 @@ const postcssFlexibility = () => ({
            }
        });
    }
-});
-
-postcssFlexibility.postcss = true;
+   }
+};

-export default postcssFlexibility;
+module.exports.postcss = true;

Here's the diff file - https://share.bsf.io/rRujRGoW

let me know if this is still unclear, I can re-do the PR with separate commits for the fix and the lint fix

7rulnik commented 2 years ago

@Nikschavan oh I see. I had some worries about export default. To be honest, I would like to use it, but seems that there are some problems with transpiling. Will take a look!

Nikschavan commented 2 years ago

Did you check this @7rulnik

adamyala commented 1 year ago

Many thank yous @Nikschavan 🙏 Your change fixed the issue for me.