-
Notifications
You must be signed in to change notification settings - Fork 10
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
import attributes for standard module formats; CSS and JSON #923
Labels
alpha.2
CLI
documentation
Greenwood specific docs
feature
New feature or request
Plugins
Greenwood Plugins
sponsorship:eligible
SSR
v0.30.0
Milestone
Comments
thescientist13
added
Plugins
Greenwood Plugins
CLI
feature
New feature or request
labels
Apr 1, 2022
23 tasks
thescientist13
moved this to 📋 Backlog
in [Greenwood] Phase 9 - Standards and Conventions
Nov 9, 2022
thescientist13
changed the title
import assertions for CSS Modules
import assertions for CSS Modules (and custom resources?)
Nov 20, 2022
thescientist13
changed the title
import assertions for CSS Modules (and custom resources?)
import assertions for standard module formats (CSS, JSON)
Nov 20, 2022
thescientist13
changed the title
import assertions for standard module formats (CSS, JSON)
import assertions for standard module formats; CSS and JSON
Nov 20, 2022
This was referenced Nov 20, 2022
FWIW, esbuild is working on this for CSS - evanw/esbuild#20 |
3 tasks
8 tasks
thescientist13
moved this from 🔖 Ready
to 🏗 In progress
in [Greenwood] Phase 9 - Standards and Conventions
Mar 18, 2024
thescientist13
changed the title
import assertions for standard module formats; CSS and JSON
import attributes for standard module formats; CSS and JSON
Mar 18, 2024
27 tasks
This was referenced Apr 10, 2024
8 tasks
thescientist13
moved this from 🏗 In progress
to 👀 In review
in [Greenwood] Phase 9 - Standards and Conventions
Apr 24, 2024
27 tasks
github-project-automation
bot
moved this from 👀 In review
to ✅ Done
in [Greenwood] Phase 9 - Standards and Conventions
May 4, 2024
8 tasks
11 tasks
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
alpha.2
CLI
documentation
Greenwood specific docs
feature
New feature or request
Plugins
Greenwood Plugins
sponsorship:eligible
SSR
v0.30.0
Summary
Related to #606 / #878
Currently we have a plugin for being able to
import
CSS, but it is non standard. Luckily, there is a standard coming for this in browsers and NodeJS! Here is an example and overviewDetails
Basically, what I would love to do is make this out of the box with Greenwood, or at least support it in plugin-import-css so that the plugin supports the standard syntax, and eventually, when all browser support CSS modules, user's can just stop using the plugin.
Scenarios that need to be handled:
import
JSON, CSS) for SSR #878type=xxx
as it breaks in NodeJSThere is a a repo tracking this across bundlers as well
https://github.com/nicolo-ribaudo/import-attributes-ecosystem-support
If this goes well, we should try and do the same with JSON. Should also document / update any impact this may have on the Import CSS plugin.
This could also clean up the experimental loader, which should be able to just leverage native import assertions now for JSON.
Might also be worth cross-referencing with other custom resource types like TypeScript and GraphQL - #1004
Something to keep in mind re: Rollup support has not landed yet - rollup/rollup#4818
For at least for Rollup
3.x
, looks like we could do something like thisUnfortunately that path tops out at 3.x since in 4.x they removed the ability to parse custom syntax using acorn - https://rollupjs.org/migration/#configuration-changes
So I think we'll have to:
3.x
#1087The text was updated successfully, but these errors were encountered: