Skip to content

Implement eager postcss preprocessing#6

Open
arggh wants to merge 1 commit into
zodern:masterfrom
arggh:eager-postcss-preprocessing
Open

Implement eager postcss preprocessing#6
arggh wants to merge 1 commit into
zodern:masterfrom
arggh:eager-postcss-preprocessing

Conversation

@arggh

@arggh arggh commented Jul 23, 2021

Copy link
Copy Markdown

Uses PostCSS preprocessing, if postcss is configured & available and there is no conflicting lang attribute present in the <style> tag.

Fixes #5

@zodern zodern mentioned this pull request Jul 23, 2021
Comment thread MelteCompiler.js
code: await this.postcss.process(content, { from: undefined })
};
}
if (this.postcss && (!attributes.lang || attributes.lang === 'postcss')) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For version 2 of melte-compiler, we should remove the checks for attribute.lang and always run postcss to match what svelte-preprocessor does (it runs the preprocessor for the lang if there is one, and then runs postcss).

To avoid introducing a backwards breaking change now, could we add an option for this behaviour?

@arggh arggh Aug 14, 2021

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that's what I suggested in #5

What would you like the config option to be named? I'm happy to update the PR.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what a good name would be. Maybe something like alwaysUsePostCSS?

@zodern

zodern commented Feb 12, 2022

Copy link
Copy Markdown
Owner

Meteor 2.6.1 adds built-in support for postcss in its standard-minifier-css package, and when svelte's css option is disabled, all of the styles from svelte will be passed through standard-minifier-css.

I'm thinking of deprecating melte's postcss integration, and instead recommending disabling the css option if you want to use PostCSS. What do you think? Are there still benefits to having melte run postcss plugins?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: config to force postcss preprocessing on all files

2 participants