Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New "strict order" option for preprocessor #4222

Closed
wants to merge 15 commits into from
Closed

New "strict order" option for preprocessor #4222

wants to merge 15 commits into from

Conversation

matyunya
Copy link

@matyunya matyunya commented Jan 7, 2020

Original discussion: sveltejs/rollup-plugin-svelte#86 (comment).

Issue: #4141

New option allows users to specify strict order in which preprocessors must be applied, specifically for the case when Sass preprocessor must run before Svelte image to work properly.

@Conduitry
Copy link
Member

What happens when you enable strict ordering and some of the objects in the array of preprocessors contain multiple types of preprocessors in the same object? I'm not positive what I would want to happen. Run markup and then the other two? Throw an exception?

@matyunya
Copy link
Author

matyunya commented Jan 7, 2020

Since we're allowing users to specify only the order of preprocessor groups inside the group the behaviour remains the same, seems the best way to me:

if (p.markup) {
			processed = await process_markup(source, p.markup, filename);
			source = processed.source;
if (p.script) {
			processed = await process_script(source, p.script, filename);
			source = processed.source;
if (p.style) {
			processed = await process_style(source, p.style, filename);
			source = processed.source;

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.

3 participants