-
Notifications
You must be signed in to change notification settings - Fork 188
feat: integrate @rsbuild-image/rspress
into website
#2156
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
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for rspress-v2 failed. Why did it fail? →
|
❌ Deploy Preview for rspress failed. Why did it fail? →
|
@@ -4,7 +4,7 @@ The plugin system is a crucial part of Rspress, which allows you to easily exten | |||
|
|||
The overall architecture of Rspress is shown in the figure below: | |||
|
|||
 | |||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I imported the image file as a asset module right on the zh translation. So that we can compare the different of their behaviours.
I updated the PR summary. You can see more context there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image is intented to be Rspress Architecture
, but the new one css-extract-loader
is definitely not.
"@rsbuild/plugin-sass": "~1.3.1", | ||
"@rspress/plugin-algolia": "workspace:*", | ||
"@rspress/plugin-llms": "workspace:*", | ||
"@rspress/plugin-shiki": "workspace:*", | ||
"@rstack-dev/doc-ui": "1.8.0", | ||
"@rstack/resource": "git://github.com/rspack-contrib/rstack-design-resources.git", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least it should be https://
protocol. And it's strange to install the whole repo although we're only relying on several resources inside.
"@rstack/resource": "git://github.com/rspack-contrib/rstack-design-resources.git", | |
"@rstack/resource": "rspack-contrib/rstack-design-resources", |
|
||
export default defineConfig({ | ||
root: path.join(__dirname, 'doc'), | ||
plugins: [pluginImage({ ipx: {} })], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{}
is confused to users,
could this option be set to pluginImage({ ipx: true })
?
Summary
I'm working on the Rsbuild Image and which is a rsbuild plugin can bring image compiling and rendering optimizations into any Rsbuild-based applications.
And here is its rspress plugin, I integrated it into our website. Which provides lots of optimization approaches and some of them heavily relay on the compile-time analyzing. Since it perfer to store all of our image assets to the bytedance owned CDN or the https://github.com/rspack-contrib/rstack-design-resources repo (to reduce the file scaling of rspress repo?). I have to install the rstack-design-resources repo as a npm package to make all the assets resolvable.
Plugin Integration
@rsbuild-image/rspress
plugin configuration torspress.config.ts
files in both thee2e/fixtures/rsbuild-image
andpackages/document
directories to enable image processing with IPX.Documentation Updates
css-extract-loader.png
). Which is only used for demostration. You can visit and compare the differences between and to check the image optimizations.End-to-End Testing
plugin-image.test.ts
to validate the functionality of the image plugin, including rendering and responsive behavior of images.Fixture Setup for Testing
e2e/fixtures/rsbuild-image
with configuration files (package.json
,rspress.config.ts
,index.mdx
,tsconfig.json
) to support plugin testing.Configuration Enhancements
@assets/*
in thetsconfig.json
file for thepackages/document
directory to streamline asset imports..vscode/settings.json
to exclude the.rslib
directory from search and indexing.Related Issue
Checklist