postcss-flexibility icon indicating copy to clipboard operation
postcss-flexibility copied to clipboard

Fix: PostCSS plugin not recognised when loading under Laravel Mix

Open Nikschavan opened this issue 2 years ago • 5 comments

Fixes #145

Nikschavan avatar Jul 15 '21 08:07 Nikschavan

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

7rulnik avatar Jul 15 '21 09:07 7rulnik

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

Nikschavan avatar Jul 15 '21 10:07 Nikschavan

@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!

7rulnik avatar Jul 15 '21 10:07 7rulnik

Did you check this @7rulnik

Nikschavan avatar Aug 27 '21 06:08 Nikschavan

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

adamyala avatar Jul 14 '22 20:07 adamyala