Skip to content

break: remove css option #147

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

Merged
merged 7 commits into from
Nov 23, 2020
Merged

break: remove css option #147

merged 7 commits into from
Nov 23, 2020

Conversation

lukeed
Copy link
Member

@lukeed lukeed commented Oct 22, 2020

Closes #146

As discussed in Discord, we'll just pitch CSS contents into Rollup. Anything else (transforming, actually getting the CSS contents written into a file, etc) needs to be handled by another plugin now.

RIP #136 #140

@lukeed
Copy link
Member Author

lukeed commented Oct 22, 2020

Thanks for approval, but not convinced this is done quite yet. Right now a css.map is inlined automatically:

compiled.css.code += `\n/*# sourceMappingURL=${compiled.css.map.toUrl()} */`;

I think that should be removed since it'll be included in the load output when found, and the consumer of the virtual file will decide what to do with it.

@benmccann
Copy link
Member

I'm not totally sure I understand the issue you're talking about @lukeed, but it seems separable and unrelated to the css option, so I wonder if we should go ahead with this PR and possibly do that in a follow up?

@benmccann
Copy link
Member

Actually, one last thought I had on this PR - we should probably default emitCss to true, right? I would expect that we're going to set emitCss: true in both sveltejs/template and in sveltejs/sapper-template and most users will be setting it to true in a corresponding fashion, so that's probably the better default since it will be the most commonly used value.

@lukeed
Copy link
Member Author

lukeed commented Nov 20, 2020

we should probably default emitCss to true, right?

Yes I think so – since we also recommended against inlining CSS inside the JS code.

@benmccann
Copy link
Member

Ok, I updated this PR to stop inlining the sourcemap and default emitCss to true. I'm happy to merge this now if you are

@lukeed
Copy link
Member Author

lukeed commented Nov 23, 2020

Think we're done here too. Thanks @benmccann !

@nolanlawson
Copy link

Sorry if this is the wrong place to ask this question, but what is the recommended replacement for css: true (i.e. inlining the CSS in the JS)? I'm reading the changelog and rollup-plugin-css-only, but I only see how to extract into a bundle.css file, not retain the old CSS-in-JS behavior.

@lukeed
Copy link
Member Author

lukeed commented Dec 19, 2020

Use emitCss: false, though like before it's not recommended

philipp-tailor added a commit to philipp-tailor/svelte_sidebar that referenced this pull request Feb 13, 2021
...  after breaking update.

Re-aligned the configuration as demonstrated
[here](https://github.com/sveltejs/template/blob/5b1135c286f7a649daa99825a077586655051649/rollup.config.js#L48).

The breaking changes were:
* [removing CSS extraction](sveltejs/rollup-plugin-svelte#147)
* [nesting compiler options in key](sveltejs/rollup-plugin-svelte#145)
philipp-tailor added a commit to philipp-tailor/svelte_sidebar that referenced this pull request Feb 13, 2021
* build(deps-dev): bump rollup-plugin-svelte from 6.1.1 to 7.1.0

Bumps [rollup-plugin-svelte](https://github.com/sveltejs/rollup-plugin-svelte) from 6.1.1 to 7.1.0.
- [Release notes](https://github.com/sveltejs/rollup-plugin-svelte/releases)
- [Changelog](https://github.com/sveltejs/rollup-plugin-svelte/blob/master/CHANGELOG.md)
- [Commits](sveltejs/rollup-plugin-svelte@v6.1.1...v7.1.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>

* chore: re-configure rollup-plugin-svelte

...  after breaking update.

Re-aligned the configuration as demonstrated
[here](https://github.com/sveltejs/template/blob/5b1135c286f7a649daa99825a077586655051649/rollup.config.js#L48).

The breaking changes were:
* [removing CSS extraction](sveltejs/rollup-plugin-svelte#147)
* [nesting compiler options in key](sveltejs/rollup-plugin-svelte#145)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Philipp Schneider <[email protected]>
joshrayman added a commit to joshrayman/layercake-template that referenced this pull request Dec 9, 2021
As discussed in mhkeller#5, fixing the breaking change caused by: sveltejs/rollup-plugin-svelte#147
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.

Merge options: css + emitCss
3 participants