├── .github
├── renovate.json5
└── workflows
│ └── ci.yaml
├── .gitignore
├── .husky
└── pre-commit
├── .npmrc
├── .nvmrc
├── .vscode
├── extensions.json
└── settings.json
├── LICENSE
├── README.md
├── biome.json
├── package.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── rsbuild
├── emotion
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── express
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.mjs
│ ├── server.mjs
│ └── src
│ │ ├── index.css
│ │ └── index.js
├── fastify
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.mjs
│ ├── server.mjs
│ └── src
│ │ ├── index.css
│ │ └── index.js
├── lit
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ ├── index.html
│ │ ├── index.ts
│ │ └── my-element.ts
│ └── tsconfig.json
├── module-federation-enhanced
│ ├── consumer
│ │ ├── .gitignore
│ │ ├── module-federation.config.ts
│ │ ├── package.json
│ │ ├── rsbuild.config.ts
│ │ ├── src
│ │ │ ├── App.css
│ │ │ ├── App.tsx
│ │ │ ├── bootstrap.tsx
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ └── provider
│ │ ├── .gitignore
│ │ ├── package.json
│ │ ├── rsbuild.config.ts
│ │ ├── src
│ │ ├── App.tsx
│ │ ├── Button.tsx
│ │ ├── bootstrap.tsx
│ │ └── index.ts
│ │ └── tsconfig.json
├── module-federation
│ ├── host
│ │ ├── .gitignore
│ │ ├── module-federation.config.ts
│ │ ├── package.json
│ │ ├── rsbuild.config.ts
│ │ ├── src
│ │ │ ├── App.js
│ │ │ ├── bootstrap.js
│ │ │ └── index.js
│ │ └── tsconfig.json
│ └── remote
│ │ ├── .gitignore
│ │ ├── module-federation.config.ts
│ │ ├── package.json
│ │ ├── rsbuild.config.ts
│ │ ├── src
│ │ ├── App.js
│ │ ├── Button.js
│ │ ├── bootstrap.js
│ │ └── index.js
│ │ └── tsconfig.json
├── preact
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ └── index.tsx
│ └── tsconfig.json
├── query-raw
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── react-compiler-babel
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── react-eslint
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── react-jest
│ ├── .gitignore
│ ├── README.md
│ ├── jest-setup.ts
│ ├── jest.config.ts
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ ├── tests
│ │ ├── App.spec.tsx
│ │ ├── __mocks__
│ │ │ ├── fileMock.js
│ │ │ └── styleMock.js
│ │ └── tsconfig.json
│ └── tsconfig.json
├── react-mdx
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── hello.mdx
│ │ └── index.tsx
│ └── tsconfig.json
├── react-tailwindcss-v4
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── postcss.config.mjs
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── react-tailwindcss
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── postcss.config.mjs
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ ├── tailwind.config.ts
│ └── tsconfig.json
├── react-unocss
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── index.css
│ │ ├── index.tsx
│ │ └── shim.d.ts
│ └── tsconfig.json
├── react
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── shadcn-ui
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ └── globals.css
│ ├── components.json
│ ├── package.json
│ ├── postcss.config.js
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── components
│ │ │ └── ui
│ │ │ │ ├── button.tsx
│ │ │ │ ├── card.tsx
│ │ │ │ ├── input.tsx
│ │ │ │ └── label.tsx
│ │ ├── env.d.ts
│ │ ├── index.tsx
│ │ └── lib
│ │ │ └── utils.ts
│ ├── tailwind.config.js
│ └── tsconfig.json
├── solid
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── ssr-express-with-manifest
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── prod-server.mjs
│ ├── rsbuild.config.mjs
│ ├── server.mjs
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.server.tsx
│ │ └── index.tsx
│ ├── template.html
│ └── tsconfig.json
├── ssr-express
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── prod-server.mjs
│ ├── rsbuild.config.mjs
│ ├── server.mjs
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.server.tsx
│ │ └── index.tsx
│ ├── template.html
│ └── tsconfig.json
├── ssr
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.server.tsx
│ │ └── index.tsx
│ ├── template.html
│ └── tsconfig.json
├── styled-components
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ └── index.tsx
│ └── tsconfig.json
├── styled-jsx
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.tsx
│ │ └── styled-jsx.d.ts
│ └── tsconfig.json
├── stylex
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.tsx
│ └── tsconfig.json
├── svelte
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.svelte
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.ts
│ └── tsconfig.json
├── umd
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── env.d.ts
│ │ ├── index.html
│ │ └── index.ts
│ └── tsconfig.json
├── vanilla-extract
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css.ts
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.tsx
│ └── tsconfig.json
├── vue2
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.vue
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.ts
│ └── tsconfig.json
├── vue3-auto-import
│ ├── .gitignore
│ ├── .vscode
│ │ └── extensions.json
│ ├── README.md
│ ├── auto-imports.d.ts
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.vue
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.ts
│ └── tsconfig.json
├── vue3-element-plus
│ ├── .gitignore
│ ├── .vscode
│ │ └── extensions.json
│ ├── README.md
│ ├── auto-imports.d.ts
│ ├── components.d.ts
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.vue
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.ts
│ └── tsconfig.json
├── vue3-eslint
│ ├── .eslintrc.cjs
│ ├── .gitignore
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.vue
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ └── index.ts
│ └── tsconfig.json
├── vue3-vant
│ ├── .gitignore
│ ├── README.md
│ ├── auto-imports.d.ts
│ ├── components.d.ts
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.vue
│ │ ├── env.d.ts
│ │ ├── index.ts
│ │ └── static
│ │ │ └── apple.jpeg
│ └── tsconfig.json
└── vue3
│ ├── .gitignore
│ ├── .vscode
│ └── extensions.json
│ ├── README.md
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ ├── App.vue
│ ├── env.d.ts
│ ├── index.css
│ └── index.ts
│ └── tsconfig.json
├── rsdoctor
├── rsbuild
│ ├── package.json
│ ├── rsbuild.config.ts
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── button.css
│ │ ├── env.d.ts
│ │ ├── index.tsx
│ │ ├── semver.ts
│ │ └── semver7.ts
│ └── tsconfig.json
└── rspack
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ ├── App.css
│ ├── App.tsx
│ ├── button.css
│ ├── env.d.ts
│ ├── index.tsx
│ ├── semver.ts
│ └── semver7.ts
│ └── tsconfig.json
├── rspack
├── basic-ts-config
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.ts
│ ├── src
│ │ ├── answer.js
│ │ └── index.js
│ └── tsconfig.json
├── basic-ts
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.mjs
│ ├── src
│ │ ├── alias-1
│ │ │ └── a.ts
│ │ ├── alias-2
│ │ │ └── b.ts
│ │ └── index.ts
│ └── tsconfig.json
├── basic
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── builtin-swc-loader
│ ├── .gitignore
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── __generated__
│ │ └── Foo.graphql.ts
│ │ ├── index.css
│ │ ├── index.jsx
│ │ └── logo.svg
├── bundle-splitting
│ ├── common.js
│ ├── index.js
│ ├── inline.js
│ ├── manual.js
│ ├── package.json
│ └── rspack.config.mjs
├── case-sensitive-paths-webpack-plugin
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── code-splitting
│ ├── answer.js
│ ├── index.html
│ ├── index.js
│ ├── package.json
│ ├── rspack.config.mjs
│ └── static.js
├── common-libs
│ ├── README.md
│ ├── lib1
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── components
│ │ │ │ └── tab.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── lib2
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── components
│ │ │ │ └── button.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ └── lib3
│ │ ├── package.json
│ │ └── src
│ │ └── index.js
├── cra-ts
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.test.tsx
│ │ ├── App.tsx
│ │ ├── index.css
│ │ ├── index.tsx
│ │ ├── logo.svg
│ │ ├── react-app-env.d.ts
│ │ ├── reportWebVitals.ts
│ │ └── setupTests.ts
├── cra
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.jsx
│ │ ├── logo.svg
│ │ ├── reportWebVitals.js
│ │ └── setupTests.js
├── css-parser-generator-options
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── global.css
│ │ ├── index.js
│ │ ├── legacy
│ │ └── index.css
│ │ └── style.module.scss
├── dll-reference
│ ├── index.js
│ ├── package.json
│ └── rspack.config.js
├── dll
│ ├── a.ts
│ ├── alpha.ts
│ ├── b.ts
│ ├── beta.ts
│ ├── c.tsx
│ ├── package.json
│ └── rspack.config.js
├── emotion
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.jsx
├── eslint
│ ├── .eslintrc.js
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── rspack.config.loader.js
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── express
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── api
│ │ └── root.ts
│ │ └── main.ts
├── extract-license
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.js
├── generate-package-json-webpack-plugin@2
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.js
├── hooks
│ └── after-resolve
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ ├── answer.js
│ │ └── index.js
├── html-webpack-plugin
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.js
├── http-import
│ ├── .gitignore
│ ├── http-import.lock
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ └── index.js
├── lazy-compilation-server
│ ├── dev.js
│ ├── package.json
│ └── src
│ │ ├── index.js
│ │ ├── info.js
│ │ └── show-msg.js
├── library-cjs
│ ├── README.md
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── answer.js
│ │ ├── index.js
│ │ └── secret.js
├── library-esm
│ ├── README.md
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── answer.js
│ │ ├── index.js
│ │ └── secret.js
├── library-umd
│ ├── README.md
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── answer.js
│ │ ├── index.js
│ │ └── secret.js
├── license-webpack-plugin
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.jsx
├── lightingcss-loader
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.css
│ │ ├── answer.js
│ │ ├── index.css
│ │ └── index.js
├── loader-compat
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── a.json
│ │ ├── arco.svg
│ │ ├── b.less
│ │ ├── c.scss
│ │ ├── d.yaml
│ │ ├── e.styl
│ │ ├── f.js
│ │ ├── g.md
│ │ ├── h.png
│ │ ├── index.js
│ │ ├── j.txt
│ │ ├── k.ts
│ │ ├── l.png
│ │ └── logo.svg
├── minify-test
│ ├── a.js
│ ├── a2.js
│ ├── b.js
│ ├── index.js
│ └── rspack.config.js
├── module-federation-interop
│ ├── README.md
│ ├── package.json
│ ├── rspack-mf-v1.5
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── Component.js
│ │ │ ├── bootstrap.js
│ │ │ ├── index.js
│ │ │ └── runtimePlugins
│ │ │ └── logger.js
│ ├── rspack-mf-v1
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── Component.js
│ │ │ ├── bootstrap.js
│ │ │ └── index.js
│ └── webpack-mf
│ │ ├── package.json
│ │ ├── src
│ │ ├── Component.js
│ │ ├── bootstrap.js
│ │ └── index.js
│ │ └── webpack.config.js
├── module-federation-v1.5
│ ├── app
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── App.js
│ │ │ ├── bootstrap.js
│ │ │ ├── index.js
│ │ │ └── runtimePlugins
│ │ │ └── logger.js
│ ├── lib1
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── Component.js
│ │ │ ├── bootstrap.js
│ │ │ └── index.js
│ ├── lib2
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── Component.js
│ │ │ └── LazyComponent.js
│ └── package.json
├── module-federation-v1
│ ├── app
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── App.js
│ │ │ ├── bootstrap.js
│ │ │ └── index.js
│ ├── lib1
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── Component.js
│ │ │ ├── bootstrap.js
│ │ │ └── index.js
│ ├── lib2
│ │ ├── package.json
│ │ ├── rspack.config.js
│ │ └── src
│ │ │ ├── Component.js
│ │ │ └── LazyComponent.js
│ └── package.json
├── monaco-editor-js
│ ├── index.html
│ ├── index.js
│ ├── package.json
│ └── rspack.config.js
├── monaco-editor-ts-react
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── components
│ │ │ └── Editor.tsx
│ │ ├── index.css
│ │ ├── index.html
│ │ └── index.tsx
│ └── tsconfig.json
├── monaco-editor-webpack-plugin
│ ├── index.html
│ ├── index.js
│ ├── package.json
│ └── rspack.config.js
├── multi-entry
│ ├── answer.js
│ ├── index.js
│ ├── package.json
│ ├── rspack.config.js
│ ├── second.js
│ └── static.js
├── nest-alias
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.json
│ └── webpack.config.js
├── nestjs
│ ├── README.md
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── app.controller.ts
│ │ ├── app.module.ts
│ │ ├── app.service.ts
│ │ └── main.ts
├── next-rspack-app-router
│ ├── .gitignore
│ ├── README.md
│ ├── app
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── next.config.js
│ ├── package.json
│ └── tsconfig.json
├── next-rspack-page-router
│ ├── .gitignore
│ ├── README.md
│ ├── next.config.js
│ ├── package.json
│ ├── pages
│ │ ├── _app.tsx
│ │ ├── _document.tsx
│ │ ├── api
│ │ │ └── hello.ts
│ │ └── index.tsx
│ ├── public
│ │ ├── favicon.ico
│ │ ├── file.svg
│ │ ├── globe.svg
│ │ ├── next.svg
│ │ ├── vercel.svg
│ │ └── window.svg
│ ├── styles
│ │ ├── Home.module.css
│ │ └── globals.css
│ └── tsconfig.json
├── node-globals-shim
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.js
│ │ ├── index.js
│ │ ├── process-shim.js
│ │ └── util.js
├── node-polyfill
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── index.js
│ │ └── logger.js
├── perfsee
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── polyfill
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── postcss-loader
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── index.css
│ │ └── index.js
├── preact-refresh
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── index.css
│ │ ├── index.jsx
│ │ └── logo.svg
├── preact
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── index.css
│ │ ├── index.jsx
│ │ └── logo.svg
├── proxy
│ ├── index.js
│ ├── package.json
│ └── rspack.config.js
├── react-compiler-babel-ts
│ ├── babel.config.js
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── env.d.ts
│ │ ├── index.css
│ │ ├── index.tsx
│ │ └── logo.svg
│ └── tsconfig.json
├── react-compiler-babel
│ ├── babel.config.js
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── index.css
│ │ ├── index.jsx
│ │ └── logo.svg
├── react-refresh-babel-loader
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.tsx
│ │ ├── ArrowFunction.tsx
│ │ ├── ClassDefault.tsx
│ │ ├── ClassNamed.tsx
│ │ ├── FunctionDefault.tsx
│ │ ├── FunctionNamed.tsx
│ │ ├── LazyComponent.tsx
│ │ └── index.tsx
├── react-refresh
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.tsx
│ │ ├── ArrowFunction.tsx
│ │ ├── ClassDefault.tsx
│ │ ├── ClassNamed.tsx
│ │ ├── FunctionDefault.tsx
│ │ ├── FunctionNamed.tsx
│ │ ├── LazyComponent.tsx
│ │ └── index.tsx
├── react-with-extract-css
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── components
│ │ ├── hello-world.jsx
│ │ └── index.module.less
│ │ ├── index.jsx
│ │ ├── style
│ │ └── themes
│ │ │ ├── default.less
│ │ │ └── index.less
│ │ └── styles.less
├── react-with-less
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── components
│ │ ├── hello-world.jsx
│ │ └── index.less
│ │ ├── index.jsx
│ │ ├── style
│ │ └── themes
│ │ │ ├── default.less
│ │ │ └── index.less
│ │ └── styles.less
├── react-with-sass
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── components
│ │ ├── hello-world.jsx
│ │ └── hello-world.sass
│ │ ├── index.jsx
│ │ ├── reset.css
│ │ └── styles.scss
├── react
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── index.css
│ │ ├── index.jsx
│ │ └── logo.svg
├── rspack-manifest-plugin
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ └── index.js
│ └── test.js
├── sentry
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── solid
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.jsx
│ │ ├── App.module.css
│ │ ├── Message.jsx
│ │ ├── assets
│ │ └── favicon.ico
│ │ ├── index.css
│ │ ├── index.jsx
│ │ └── logo.svg
├── source-map-with-vscode-debugging
│ ├── .vscode
│ │ └── launch.json
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── hello-world.jsx
│ │ └── index.jsx
├── stats
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── styled-components
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.tsx
├── svelte
│ ├── .gitignore
│ ├── .postcssrc
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ └── favicon.png
│ ├── rspack.config.js
│ ├── src
│ │ ├── App.svelte
│ │ ├── Nested.svelte
│ │ ├── global.css
│ │ └── main.ts
│ └── tsconfig.json
├── svgr
│ ├── index.html
│ ├── index.jsx
│ ├── logo.svg
│ ├── package.json
│ └── rspack.config.js
├── tailwind-jit
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── answer.js
│ │ ├── index.js
│ │ └── main.css
│ └── tailwind.config.js
├── tailwind
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── answer.js
│ │ ├── index.js
│ │ └── main.css
│ └── tailwind.config.js
├── terser-webpack-plugin
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.js
├── treeshaking-transform-imports
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── a.js
│ │ ├── b.js
│ │ ├── c.js
│ │ ├── index.js
│ │ └── sdk.js
├── ts-checker-rspack-plugin
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── unplugin-auto-import
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.vue
│ │ ├── HelloWorld.vue
│ │ └── index.js
├── vanilla-extract-css
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── App.css.ts
│ │ ├── App.tsx
│ │ ├── global.css.ts
│ │ ├── index.tsx
│ │ ├── sprinkles.css.ts
│ │ └── vars.css.ts
│ └── tsconfig.json
├── vue
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.vue
│ │ ├── assets
│ │ ├── rspack.svg
│ │ └── vue.svg
│ │ ├── components
│ │ └── HelloWorld.vue
│ │ ├── main.js
│ │ └── style.css
├── vue2-ts
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.vue
│ │ ├── assets
│ │ ├── rspack.svg
│ │ └── vue.svg
│ │ ├── components
│ │ └── HelloWorld.vue
│ │ ├── main.ts
│ │ └── style.css
├── vue2-tsx
│ ├── global.d.ts
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── App.vue
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── components
│ │ │ ├── SFC_JSX_Counter.vue
│ │ │ ├── SFC_TSX_Counter.vue
│ │ │ └── TSX_Counter.tsx
│ │ ├── main.ts
│ │ └── style.less
│ └── tsconfig.json
├── vue2
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.vue
│ │ ├── assets
│ │ ├── rspack.svg
│ │ └── vue.svg
│ │ ├── components
│ │ └── HelloWorld.vue
│ │ ├── main.js
│ │ └── style.css
├── vue3-jsx
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.css
│ │ ├── App.jsx
│ │ ├── assets
│ │ └── vue.svg
│ │ ├── index.css
│ │ └── main.jsx
├── vue3-tsx
│ ├── global.d.ts
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── Button.vue
│ │ ├── assets
│ │ │ └── vue.svg
│ │ ├── index.css
│ │ └── main.tsx
│ └── tsconfig.json
├── vue3-vanilla
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── App.vue
│ │ ├── assets
│ │ ├── rspack.svg
│ │ └── vue.svg
│ │ ├── components
│ │ └── HelloWorld.vue
│ │ ├── main.js
│ │ └── style.css
├── wasm-simple
│ ├── add.wasm
│ ├── example.js
│ ├── factorial.wasm
│ ├── fibonacci.wasm
│ ├── math.js
│ ├── package.json
│ └── rspack.config.js
├── webpack-bundle-analyzer
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.js
├── webpack-stats-plugin
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ └── index.js
├── workbox-webpack-plugin
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ │ ├── answer.js
│ │ └── index.js
├── worker-inline
│ ├── index.html
│ ├── package.json
│ ├── rspack.config.mjs
│ └── src
│ │ ├── index.js
│ │ └── worker.js
├── worker
│ ├── chat-module.js
│ ├── chat-worker.js
│ ├── example.js
│ ├── fib-worker.js
│ ├── fibonacci.js
│ ├── index.html
│ ├── package.json
│ └── rspack.config.js
└── worklet
│ ├── index.html
│ ├── loader
│ └── worklet-loader.js
│ ├── package.json
│ ├── rspack.config.js
│ └── src
│ ├── answer.js
│ ├── index.js
│ ├── lib.js
│ └── worklet
│ ├── answer.ts
│ ├── complex.worklet.js
│ └── simple.worklet.js
├── rspress
├── basic
│ ├── .gitignore
│ ├── docs
│ │ ├── _meta.json
│ │ ├── guide
│ │ │ ├── _meta.json
│ │ │ └── index.md
│ │ ├── hello.md
│ │ ├── index.md
│ │ └── public
│ │ │ ├── rspress-dark-logo.png
│ │ │ ├── rspress-icon.png
│ │ │ └── rspress-light-logo.png
│ ├── package.json
│ ├── rspress.config.ts
│ └── tsconfig.json
└── custom-theme
│ ├── .gitignore
│ ├── docs
│ ├── hello.md
│ └── index.md
│ ├── package.json
│ ├── rspress.config.ts
│ ├── theme
│ └── index.tsx
│ └── tsconfig.json
├── taze.config.ts
└── tsconfig.base.json
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | npx lint-staged
2 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry = 'https://registry.npmjs.org/'
2 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 18.20.8
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["biomejs.biome"]
3 | }
4 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "rspack/**"
3 | - "rsbuild/**"
4 | - "rspress/**"
5 | - "rsdoctor/**"
6 | - "!**/dist"
7 |
--------------------------------------------------------------------------------
/rsbuild/emotion/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/emotion/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/emotion/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/emotion/src/index.tsx:
--------------------------------------------------------------------------------
1 | import ReactDOM from 'react-dom/client';
2 | import App from './App';
3 |
4 | const root = ReactDOM.createRoot(document.getElementById('root')!);
5 | root.render();
6 |
--------------------------------------------------------------------------------
/rsbuild/emotion/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "jsxImportSource": "@emotion/react",
8 | "strict": true,
9 | "skipLibCheck": true,
10 | "isolatedModules": true,
11 | "resolveJsonModule": true,
12 | "moduleResolution": "bundler"
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/express/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/express/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/express/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rsbuild-express",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "rsbuild build",
7 | "dev": "node ./server.mjs",
8 | "preview": "rsbuild preview"
9 | },
10 | "devDependencies": {
11 | "@rsbuild/core": "1.3.22",
12 | "@types/express": "^5.0.3",
13 | "express": "^5.1.0",
14 | "typescript": "^5.8.3"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rsbuild/express/rsbuild.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 |
3 | export default defineConfig({});
4 |
--------------------------------------------------------------------------------
/rsbuild/express/src/index.js:
--------------------------------------------------------------------------------
1 | import './index.css';
2 |
3 | document.querySelector('#root').innerHTML = `
4 |
5 |
Rsbuild with Express
6 |
Start building amazing things with Rsbuild.
7 |
8 | `;
9 |
--------------------------------------------------------------------------------
/rsbuild/fastify/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/fastify/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/fastify/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rsbuild-fastify",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "rsbuild build",
7 | "dev": "node ./server.mjs",
8 | "preview": "rsbuild preview"
9 | },
10 | "devDependencies": {
11 | "@fastify/middie": "^9.0.3",
12 | "@rsbuild/core": "1.3.22",
13 | "fastify": "^5.3.3",
14 | "typescript": "^5.8.3"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rsbuild/fastify/rsbuild.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 |
3 | export default defineConfig({});
4 |
--------------------------------------------------------------------------------
/rsbuild/fastify/src/index.js:
--------------------------------------------------------------------------------
1 | import './index.css';
2 |
3 | document.querySelector('#root').innerHTML = `
4 |
5 |
Rsbuild with Fastify
6 |
Start building amazing things with Rsbuild.
7 |
8 | `;
9 |
--------------------------------------------------------------------------------
/rsbuild/lit/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/lit/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/lit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rsbuild-lit",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "rsbuild build",
7 | "dev": "rsbuild dev --open",
8 | "preview": "rsbuild preview"
9 | },
10 | "devDependencies": {
11 | "@rsbuild/core": "1.3.22",
12 | "lit": "^3.3.0",
13 | "typescript": "^5.8.3"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/lit/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 |
3 | export default defineConfig({
4 | html: {
5 | template: './src/index.html',
6 | },
7 | });
8 |
--------------------------------------------------------------------------------
/rsbuild/lit/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/lit/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/lit/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/rsbuild/lit/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import { MyElement } from './my-element';
3 |
4 | customElements.define('my-element', MyElement);
5 |
--------------------------------------------------------------------------------
/rsbuild/lit/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "strict": true,
7 | "skipLibCheck": true,
8 | "isolatedModules": true,
9 | "resolveJsonModule": true,
10 | "moduleResolution": "bundler",
11 | "useDefineForClassFields": true
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/consumer/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
15 | # MF Types
16 | @mf-types
17 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/consumer/src/bootstrap.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './App';
4 |
5 | const container = document.getElementById('root');
6 |
7 | if (container) {
8 | const root = createRoot(container);
9 | root.render(
10 |
11 |
12 | ,
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/consumer/src/index.ts:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/provider/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/provider/src/App.tsx:
--------------------------------------------------------------------------------
1 | import LocalButton from './Button';
2 |
3 | const App = () => (
4 |
5 |
Basic Host-Remote
6 | Remote
7 |
8 |
9 | );
10 |
11 | export default App;
12 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/provider/src/Button.tsx:
--------------------------------------------------------------------------------
1 | export default function Button() {
2 | return Provider button
;
3 | }
4 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/provider/src/bootstrap.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './App';
4 |
5 | const container = document.getElementById('root');
6 |
7 | if (container) {
8 | const root = createRoot(container);
9 | root.render(
10 |
11 |
12 | ,
13 | );
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/provider/src/index.ts:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rsbuild/module-federation-enhanced/provider/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/host/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/host/src/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | const RemoteButton = React.lazy(() => import('remote/Button'));
4 |
5 | const App = () => (
6 |
7 |
Basic Host-Remote
8 | Host
9 |
10 |
11 |
12 |
13 | );
14 |
15 | export default App;
16 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/host/src/bootstrap.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './App';
4 |
5 | const container = document.getElementById('root');
6 | const root = createRoot(container);
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/host/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/host/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 | import { mfConfig } from './module-federation.config';
4 |
5 | export default defineConfig({
6 | plugins: [pluginReact()],
7 | server: {
8 | port: 3002,
9 | },
10 | moduleFederation: {
11 | options: mfConfig,
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/src/App.js:
--------------------------------------------------------------------------------
1 | import LocalButton from './Button';
2 |
3 | const App = () => (
4 |
5 |
Basic Host-Remote
6 | Remote
7 |
8 |
9 | );
10 |
11 | export default App;
12 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/src/Button.js:
--------------------------------------------------------------------------------
1 | const Button = () => ;
2 | export default Button;
3 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/src/bootstrap.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './App';
4 |
5 | const container = document.getElementById('root');
6 | const root = createRoot(container);
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rsbuild/module-federation/remote/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/preact/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/preact/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/preact/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginPreact } from '@rsbuild/plugin-preact';
3 |
4 | export default defineConfig({
5 | plugins: [pluginPreact()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/preact/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with Preact
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/preact/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { render } from 'preact';
2 | import App from './App';
3 |
4 | render(, document.getElementById('root')!);
5 |
--------------------------------------------------------------------------------
/rsbuild/query-raw/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/query-raw/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/query-raw/src/App.tsx:
--------------------------------------------------------------------------------
1 | import cssStr from './App.css?raw';
2 | import jsonStr from '../package.json?raw';
3 |
4 | console.log('cssStr', cssStr);
5 | console.log('jsonStr', jsonStr);
6 |
7 | const App = () => {
8 | return (
9 |
10 |
Rsbuild with React
11 |
Start building amazing things with Rsbuild.
12 |
13 | );
14 | };
15 |
16 | export default App;
17 |
--------------------------------------------------------------------------------
/rsbuild/query-raw/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*?raw' {
4 | const content: string;
5 | export default content;
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/query-raw/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/query-raw/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/react-compiler-babel/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/react-compiler-babel/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/react-compiler-babel/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/react-compiler-babel/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/react-compiler-babel/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react-compiler-babel/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: { browser: true, es2021: true },
4 | extends: [
5 | "eslint:recommended",
6 | "plugin:@typescript-eslint/recommended",
7 | "plugin:react-hooks/recommended",
8 | ],
9 | ignorePatterns: ["dist", ".eslintrc.cjs"],
10 | parser: "@typescript-eslint/parser",
11 | };
12 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginEslint } from '@rsbuild/plugin-eslint';
3 | import { pluginReact } from '@rsbuild/plugin-react';
4 |
5 | export default defineConfig({
6 | plugins: [pluginReact(), pluginEslint()],
7 | });
8 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react-eslint/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler",
12 | "useDefineForClassFields": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/jest-setup.ts:
--------------------------------------------------------------------------------
1 | import '@testing-library/jest-dom';
2 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [pluginReact()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/tests/App.spec.tsx:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from '../src/App';
3 |
4 | test('Renders the main page', () => {
5 | const testMessage = 'Rsbuild with React';
6 | render();
7 | expect(screen.getByText(testMessage)).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/tests/__mocks__/fileMock.js:
--------------------------------------------------------------------------------
1 | module.exports = 'test-file-stub';
2 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/tests/__mocks__/styleMock.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
2 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/tests/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "types": ["@testing-library/jest-dom"]
5 | },
6 | "include": ["./"]
7 | }
8 |
--------------------------------------------------------------------------------
/rsbuild/react-jest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler",
12 | "useDefineForClassFields": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 | import { pluginMdx } from '@rsbuild/plugin-mdx';
4 |
5 | export default defineConfig({
6 | plugins: [pluginReact(), pluginMdx()],
7 | });
8 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/src/App.tsx:
--------------------------------------------------------------------------------
1 | import Hello from './hello.mdx';
2 |
3 | const App = () => {
4 | return ;
5 | };
6 |
7 | export default App;
8 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.md' {
4 | let MDXComponent: () => JSX.Element;
5 | export default MDXComponent;
6 | }
7 |
8 | declare module '*.mdx' {
9 | let MDXComponent: () => JSX.Element;
10 | export default MDXComponent;
11 | }
12 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/src/hello.mdx:
--------------------------------------------------------------------------------
1 | # Hello, world!
2 |
3 | Below is an example of markdown in JSX.
4 |
5 |
6 | Try and change the background color to `tomato`.
7 |
8 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root'));
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react-mdx/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | '@tailwindcss/postcss': {},
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [pluginReact()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/src/App.css:
--------------------------------------------------------------------------------
1 | @import "tailwindcss";
2 |
3 | body {
4 | margin: 0;
5 | color: #fff;
6 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
7 | background-image: linear-gradient(to bottom, #020917, #101725);
8 | }
9 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss-v4/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | tailwindcss: {},
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [pluginReact()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/src/App.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | body {
6 | margin: 0;
7 | color: #fff;
8 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
9 | background-image: linear-gradient(to bottom, #020917, #101725);
10 | }
11 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import type { Config } from 'tailwindcss';
2 |
3 | export default {
4 | content: ['./src/**/*.{html,js,ts,jsx,tsx}'],
5 | theme: {
6 | extend: {},
7 | },
8 | plugins: [],
9 | } satisfies Config;
10 |
--------------------------------------------------------------------------------
/rsbuild/react-tailwindcss/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/react-unocss/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { createRoot } from 'react-dom/client';
3 | import App from './App';
4 | import './index.css';
5 | import 'uno.css';
6 |
7 | const container = document.getElementById('root');
8 | const root = createRoot(container!);
9 | root.render(
10 |
11 |
12 | ,
13 | );
14 |
--------------------------------------------------------------------------------
/rsbuild/react-unocss/src/shim.d.ts:
--------------------------------------------------------------------------------
1 | import type { AttributifyAttributes } from '@unocss/preset-attributify';
2 |
3 | declare module 'react' {
4 | interface HTMLAttributes extends AttributifyAttributes {}
5 | }
6 |
--------------------------------------------------------------------------------
/rsbuild/react-unocss/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "DOM.Iterable", "ESNext"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/react/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/react/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/react/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [pluginReact()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/react/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/react/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/react/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/react/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import path from 'path';
2 | import { defineConfig } from '@rsbuild/core';
3 | import { pluginReact } from '@rsbuild/plugin-react';
4 |
5 | export default defineConfig({
6 | source: {
7 | alias: {
8 | '@': path.resolve(__dirname, './src'),
9 | },
10 | },
11 | plugins: [pluginReact()],
12 | });
13 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/src/index.tsx:
--------------------------------------------------------------------------------
1 | import '../app/globals.css';
2 | import React from 'react';
3 | import ReactDOM from 'react-dom/client';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root')!);
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rsbuild/shadcn-ui/src/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { type ClassValue, clsx } from 'clsx';
2 | import { twMerge } from 'tailwind-merge';
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs));
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/solid/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/solid/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/solid/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginBabel } from '@rsbuild/plugin-babel';
3 | import { pluginSolid } from '@rsbuild/plugin-solid';
4 |
5 | export default defineConfig({
6 | plugins: [
7 | pluginBabel({
8 | include: /\.(?:jsx|tsx)$/,
9 | exclude: /[\\/]node_modules[\\/]/,
10 | }),
11 | pluginSolid(),
12 | ],
13 | });
14 |
--------------------------------------------------------------------------------
/rsbuild/solid/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with Solid
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/solid/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/solid/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { render } from 'solid-js/web';
2 | import App from './App';
3 |
4 | render(() => , document.getElementById('root')!);
5 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/src/index.server.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOMServer from 'react-dom/server';
3 | import App from './App';
4 |
5 | export function render() {
6 | return ReactDOMServer.renderToString(
7 |
8 |
9 | ,
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | ReactDOM.hydrateRoot(
6 | document.getElementById('root')!,
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Rsbuild + Express + SSR
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express-with-manifest/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/src/index.server.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOMServer from 'react-dom/server';
3 | import App from './App';
4 |
5 | export function render() {
6 | return ReactDOMServer.renderToString(
7 |
8 |
9 | ,
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | ReactDOM.hydrateRoot(
6 | document.getElementById('root')!,
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Rsbuild + Express + SSR
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rsbuild/ssr-express/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/ssr/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/ssr/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/ssr/src/index.server.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOMServer from 'react-dom/server';
3 | import App from './App';
4 |
5 | export function render() {
6 | return ReactDOMServer.renderToString(
7 |
8 |
9 | ,
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/rsbuild/ssr/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | ReactDOM.hydrateRoot(
6 | document.getElementById('root')!,
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/ssr/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Rsbuild + React + TS
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rsbuild/ssr/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/styled-components/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/styled-components/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/styled-components/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 | import { pluginStyledComponents } from '@rsbuild/plugin-styled-components';
4 |
5 | export default defineConfig({
6 | plugins: [pluginReact(), pluginStyledComponents()],
7 | });
8 |
--------------------------------------------------------------------------------
/rsbuild/styled-components/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/styled-components/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/styled-components/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 |
4 | export default defineConfig({
5 | plugins: [pluginReact()],
6 | tools: {
7 | swc: {
8 | jsc: {
9 | experimental: {
10 | plugins: [['@swc/plugin-styled-jsx', {}]],
11 | },
12 | },
13 | },
14 | },
15 | });
16 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/src/styled-jsx.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/styled-jsx/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/stylex/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/stylex/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/stylex/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginReact } from '@rsbuild/plugin-react';
3 | import stylexPlugin from 'unplugin-stylex/rspack';
4 |
5 | export default defineConfig({
6 | plugins: [pluginReact()],
7 | tools: {
8 | rspack: {
9 | plugins: [stylexPlugin()],
10 | },
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/rsbuild/stylex/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/stylex/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/stylex/src/index.tsx:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import React from 'react';
3 | import ReactDOM from 'react-dom/client';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root')!);
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rsbuild/stylex/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/svelte/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/svelte/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/svelte/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginSvelte } from '@rsbuild/plugin-svelte';
3 |
4 | export default defineConfig({
5 | plugins: [pluginSvelte()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/svelte/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/rsbuild/svelte/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/svelte/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import App from './App.svelte';
3 |
4 | const app = new App({
5 | target: document.body,
6 | props: {
7 | name: 'world',
8 | },
9 | });
10 |
11 | export default app;
12 |
--------------------------------------------------------------------------------
/rsbuild/svelte/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "strict": true,
7 | "skipLibCheck": true,
8 | "isolatedModules": true,
9 | "resolveJsonModule": true,
10 | "moduleResolution": "bundler",
11 | "useDefineForClassFields": true
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/umd/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/umd/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/umd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rsbuild-umd",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "rsbuild build",
7 | "dev": "rsbuild dev --open",
8 | "preview": "rsbuild preview"
9 | },
10 | "devDependencies": {
11 | "@rsbuild/core": "1.3.22",
12 | "@rsbuild/plugin-umd": "^1.0.4",
13 | "typescript": "^5.8.3"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/umd/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginUmd } from '@rsbuild/plugin-umd';
3 |
4 | export default defineConfig({
5 | plugins: [
6 | pluginUmd({
7 | name: 'myLib',
8 | }),
9 | ],
10 | html: {
11 | template: './src/index.html',
12 | },
13 | tools: {
14 | htmlPlugin: true,
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/rsbuild/umd/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/umd/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/rsbuild/umd/src/index.ts:
--------------------------------------------------------------------------------
1 | export function double(a: number) {
2 | return a * 2;
3 | }
4 |
--------------------------------------------------------------------------------
/rsbuild/umd/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { contentStyle, headingStyle, paragraphStyle } from './App.css';
2 |
3 | const App = () => {
4 | return (
5 |
6 |
Rsbuild with React
7 |
Start building amazing things with Rsbuild.
8 |
9 | );
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/src/index.tsx:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import React from 'react';
3 | import ReactDOM from 'react-dom/client';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root')!);
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rsbuild/vanilla-extract/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler"
12 | },
13 | "include": ["src"]
14 | }
15 |
--------------------------------------------------------------------------------
/rsbuild/vue2/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vue2/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vue2/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginVue2 } from '@rsbuild/plugin-vue2';
3 |
4 | export default defineConfig({
5 | plugins: [pluginVue2()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/vue2/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import Vue from 'vue';
5 |
6 | export default Vue;
7 | }
8 |
--------------------------------------------------------------------------------
/rsbuild/vue2/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/vue2/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import Vue from 'vue';
3 | import App from './App.vue';
4 |
5 | new Vue({
6 | el: '#root',
7 | render: (h) => h(App),
8 | });
9 |
--------------------------------------------------------------------------------
/rsbuild/vue2/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "preserve",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler",
12 | "useDefineForClassFields": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/vue3-auto-import/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3-auto-import/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar"]
3 | }
4 |
--------------------------------------------------------------------------------
/rsbuild/vue3-auto-import/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vue3-auto-import/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import type { DefineComponent } from 'vue';
5 |
6 | // eslint-disable-next-line
7 | const component: DefineComponent<{}, {}, any>;
8 | export default component;
9 | }
10 |
--------------------------------------------------------------------------------
/rsbuild/vue3-auto-import/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/vue3-auto-import/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import App from './App.vue';
3 |
4 | createApp(App).mount('#root');
5 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar"]
3 | }
4 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/auto-imports.d.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | /* prettier-ignore */
3 | // @ts-nocheck
4 | // noinspection JSUnusedGlobalSymbols
5 | // Generated by unplugin-auto-import
6 | // biome-ignore lint: disable
7 | export {}
8 | declare global {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/components.d.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | // @ts-nocheck
3 | // Generated by unplugin-vue-components
4 | // Read more: https://github.com/vuejs/core/pull/3399
5 | export {}
6 |
7 | /* prettier-ignore */
8 | declare module 'vue' {
9 | export interface GlobalComponents {
10 | ElButton: typeof import('element-plus/es')['ElButton']
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 | I am ElButton
3 |
4 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import type { DefineComponent } from 'vue';
5 |
6 | // eslint-disable-next-line
7 | const component: DefineComponent<{}, {}, any>;
8 | export default component;
9 | }
10 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | }
6 |
7 | #root {
8 | display: flex;
9 | width: 100vw;
10 | height: 100vh;
11 | align-items: center;
12 | justify-content: center;
13 | }
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3-element-plus/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import { createApp } from 'vue';
3 | import App from './App.vue';
4 |
5 | createApp(App).mount('#root');
6 |
--------------------------------------------------------------------------------
/rsbuild/vue3-eslint/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3-eslint/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vue3-eslint/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import type { DefineComponent } from 'vue';
5 |
6 | // eslint-disable-next-line
7 | const component: DefineComponent<{}, {}, any>;
8 | export default component;
9 | }
10 |
--------------------------------------------------------------------------------
/rsbuild/vue3-eslint/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/vue3-eslint/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import { createApp } from 'vue';
3 | import App from './App.vue';
4 |
5 | createApp(App).mount('#root');
6 |
--------------------------------------------------------------------------------
/rsbuild/vue3-eslint/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "jsx": "react-jsx",
7 | "strict": true,
8 | "skipLibCheck": true,
9 | "isolatedModules": true,
10 | "resolveJsonModule": true,
11 | "moduleResolution": "bundler",
12 | "useDefineForClassFields": true
13 | },
14 | "include": ["src"]
15 | }
16 |
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/auto-imports.d.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | /* prettier-ignore */
3 | // @ts-nocheck
4 | // noinspection JSUnusedGlobalSymbols
5 | // Generated by unplugin-auto-import
6 | // biome-ignore lint: disable
7 | export {}
8 | declare global {
9 | const showToast: typeof import('vant/es')['showToast']
10 | }
11 |
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import type { DefineComponent } from 'vue';
5 |
6 | // eslint-disable-next-line
7 | const component: DefineComponent<{}, {}, any>;
8 | export default component;
9 | }
10 |
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/src/index.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './App.vue';
3 |
4 | const app = createApp(App);
5 | app.mount('#root');
6 |
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/src/static/apple.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rsbuild/vue3-vant/src/static/apple.jpeg
--------------------------------------------------------------------------------
/rsbuild/vue3-vant/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "lib": ["DOM", "ES2020"],
5 | "module": "ESNext",
6 | "strict": true,
7 | "skipLibCheck": true,
8 | "isolatedModules": true,
9 | "resolveJsonModule": true,
10 | "moduleResolution": "bundler"
11 | },
12 | "include": ["src", "./auto-imports.d.ts", "components.d.ts"]
13 | }
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3/.gitignore:
--------------------------------------------------------------------------------
1 | # Local
2 | .DS_Store
3 | *.local
4 | *.log*
5 |
6 | # Dist
7 | node_modules
8 | dist/
9 |
10 | # IDE
11 | .vscode/*
12 | !.vscode/extensions.json
13 | .idea
14 |
--------------------------------------------------------------------------------
/rsbuild/vue3/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["Vue.volar"]
3 | }
4 |
--------------------------------------------------------------------------------
/rsbuild/vue3/README.md:
--------------------------------------------------------------------------------
1 | # Rsbuild Project
2 |
3 | ## Setup
4 |
5 | Install the dependencies:
6 |
7 | ```bash
8 | pnpm install
9 | ```
10 |
11 | ## Get Started
12 |
13 | Start the dev server:
14 |
15 | ```bash
16 | pnpm dev
17 | ```
18 |
19 | Build the app for production:
20 |
21 | ```bash
22 | pnpm build
23 | ```
24 |
25 | Preview the production build locally:
26 |
27 | ```bash
28 | pnpm preview
29 | ```
30 |
--------------------------------------------------------------------------------
/rsbuild/vue3/rsbuild.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rsbuild/core';
2 | import { pluginVue } from '@rsbuild/plugin-vue';
3 |
4 | export default defineConfig({
5 | plugins: [pluginVue()],
6 | });
7 |
--------------------------------------------------------------------------------
/rsbuild/vue3/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | declare module '*.vue' {
4 | import type { DefineComponent } from 'vue';
5 |
6 | // eslint-disable-next-line
7 | const component: DefineComponent<{}, {}, any>;
8 | export default component;
9 | }
10 |
--------------------------------------------------------------------------------
/rsbuild/vue3/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | color: #fff;
4 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
5 | background-image: linear-gradient(to bottom, #020917, #101725);
6 | }
7 |
--------------------------------------------------------------------------------
/rsbuild/vue3/src/index.ts:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import { createApp } from 'vue';
3 | import App from './App.vue';
4 |
5 | createApp(App).mount('#root');
6 |
--------------------------------------------------------------------------------
/rsdoctor/rsbuild/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 | import './semver';
3 | import './semver7';
4 |
5 | const App = () => {
6 | return (
7 | <>
8 |
9 |
Rsbuild with React
10 |
Start building amazing things with Rsbuild.
11 |
12 |
13 | >
14 | );
15 | };
16 |
17 | export default App;
18 |
--------------------------------------------------------------------------------
/rsdoctor/rsbuild/src/button.css:
--------------------------------------------------------------------------------
1 | .button {
2 | display: flex;
3 | min-height: 100vh;
4 | line-height: 1.1;
5 | text-align: center;
6 | flex-direction: column;
7 | justify-content: center;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rsdoctor/rsbuild/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsdoctor/rsbuild/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rsdoctor/rspack/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rsdoctor/rspack/src/App.tsx:
--------------------------------------------------------------------------------
1 | import './App.css';
2 | import './semver';
3 | import './semver7';
4 |
5 | const App = () => {
6 | return (
7 | <>
8 |
9 |
Rsbuild with React
10 |
Start building amazing things with Rsbuild.
11 |
12 |
13 | >
14 | );
15 | };
16 |
17 | export default App;
18 |
--------------------------------------------------------------------------------
/rsdoctor/rspack/src/button.css:
--------------------------------------------------------------------------------
1 | .button {
2 | display: flex;
3 | min-height: 100vh;
4 | line-height: 1.1;
5 | text-align: center;
6 | flex-direction: column;
7 | justify-content: center;
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/rsdoctor/rspack/src/env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rsdoctor/rspack/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './App';
4 |
5 | const root = ReactDOM.createRoot(document.getElementById('root')!);
6 | root.render(
7 |
8 |
9 | ,
10 | );
11 |
--------------------------------------------------------------------------------
/rspack/basic-ts-config/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/basic-ts-config/rspack.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from '@rspack/cli';
2 | import { rspack } from '@rspack/core';
3 |
4 | export default defineConfig({
5 | entry: './src/index.js',
6 | plugins: [
7 | new rspack.HtmlRspackPlugin({
8 | template: './index.html',
9 | }),
10 | ],
11 | });
12 |
--------------------------------------------------------------------------------
/rspack/basic-ts-config/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/basic-ts-config/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/basic-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/basic-ts/src/alias-1/a.ts:
--------------------------------------------------------------------------------
1 | export const a: string = 'a';
2 |
--------------------------------------------------------------------------------
/rspack/basic-ts/src/alias-2/b.ts:
--------------------------------------------------------------------------------
1 | export const b = 'b';
2 |
--------------------------------------------------------------------------------
/rspack/basic-ts/src/index.ts:
--------------------------------------------------------------------------------
1 | import { a } from '@alias/a';
2 | import { b } from '@alias/b';
3 | console.log(a, b);
4 |
--------------------------------------------------------------------------------
/rspack/basic/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/basic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-basic",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "sideEffects": ["**/*.css", "**/*.less", "**/*.scss"],
7 | "main": "index.js",
8 | "scripts": {
9 | "build": "rspack build",
10 | "dev": "rspack serve"
11 | },
12 | "devDependencies": {
13 | "@rspack/cli": "1.3.15",
14 | "@rspack/core": "1.3.15"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rspack/basic/rspack.config.mjs:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | import { rspack } from "@rspack/core";
3 | import { defineConfig } from "@rspack/cli";
4 |
5 | export default defineConfig({
6 | entry: "./src/index.js",
7 | plugins: [
8 | new rspack.HtmlRspackPlugin({
9 | template: "./index.html",
10 | }),
11 | ],
12 | });
13 |
--------------------------------------------------------------------------------
/rspack/basic/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/basic/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/builtin-swc-loader/.gitignore:
--------------------------------------------------------------------------------
1 | .swc
--------------------------------------------------------------------------------
/rspack/builtin-swc-loader/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/builtin-swc-loader/src/__generated__/Foo.graphql.ts:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/builtin-swc-loader/src/__generated__/Foo.graphql.ts
--------------------------------------------------------------------------------
/rspack/bundle-splitting/common.js:
--------------------------------------------------------------------------------
1 | export const common = 'common';
2 |
--------------------------------------------------------------------------------
/rspack/bundle-splitting/index.js:
--------------------------------------------------------------------------------
1 | import { common } from './common';
2 | import { inline } from './inline';
3 | import { manual } from './manual';
4 | console.log('all:', manual, inline, common);
5 |
--------------------------------------------------------------------------------
/rspack/bundle-splitting/inline.js:
--------------------------------------------------------------------------------
1 | export const inline = 'inline';
2 |
--------------------------------------------------------------------------------
/rspack/bundle-splitting/manual.js:
--------------------------------------------------------------------------------
1 | export const manual = 'manual';
2 |
--------------------------------------------------------------------------------
/rspack/bundle-splitting/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-bundle-splitting",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "rspack build",
9 | "dev": "rspack serve"
10 | },
11 | "devDependencies": {
12 | "@rspack/cli": "1.3.15",
13 | "@rspack/core": "1.3.15"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rspack/case-sensitive-paths-webpack-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-case-sensitive-paths-webpack-plugin",
3 | "private": true,
4 | "scripts": {
5 | "dev": "rspack serve",
6 | "build": "rspack build || echo 'make-ci-happy'"
7 | },
8 | "devDependencies": {
9 | "@rspack/cli": "1.3.15",
10 | "@rspack/core": "1.3.15",
11 | "case-sensitive-paths-webpack-plugin": "2.4.0"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/case-sensitive-paths-webpack-plugin/rspack.config.mjs:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | import { defineConfig } from "@rspack/cli";
3 | import CaseSensitivePlugin from "case-sensitive-paths-webpack-plugin";
4 |
5 | export default defineConfig({
6 | plugins: [new CaseSensitivePlugin()],
7 | });
8 |
--------------------------------------------------------------------------------
/rspack/case-sensitive-paths-webpack-plugin/src/answer.js:
--------------------------------------------------------------------------------
1 | console.log('answer');
2 |
--------------------------------------------------------------------------------
/rspack/case-sensitive-paths-webpack-plugin/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './Answer';
2 | console.log('answer', answer);
3 |
--------------------------------------------------------------------------------
/rspack/code-splitting/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/code-splitting/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/code-splitting/index.js:
--------------------------------------------------------------------------------
1 | import { something } from './static';
2 | const a = 10;
3 | async function render() {
4 | const { answer } = await import('./answer');
5 | console.log('a:', a);
6 | console.log('answer:', answer);
7 | console.log('static:', something);
8 | document.getElementById('root').innerHTML = answer;
9 | }
10 |
11 | render();
12 |
--------------------------------------------------------------------------------
/rspack/code-splitting/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-code-splitting",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "rspack build",
9 | "dev": "rspack serve"
10 | },
11 | "devDependencies": {
12 | "@rspack/cli": "1.3.15",
13 | "@rspack/core": "1.3.15"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rspack/code-splitting/rspack.config.mjs:
--------------------------------------------------------------------------------
1 | // @ts-check
2 | import { rspack } from "@rspack/core";
3 | import { defineConfig } from "@rspack/cli";
4 |
5 | export default defineConfig({
6 | entry: {
7 | main: "./index.js",
8 | },
9 | plugins: [
10 | new rspack.HtmlRspackPlugin({
11 | template: "index.html",
12 | }),
13 | ],
14 | });
15 |
--------------------------------------------------------------------------------
/rspack/code-splitting/static.js:
--------------------------------------------------------------------------------
1 | export const something = 'static';
2 |
--------------------------------------------------------------------------------
/rspack/common-libs/README.md:
--------------------------------------------------------------------------------
1 | # Shared Library Package
2 | This is used to demonstrate monorepo usage
--------------------------------------------------------------------------------
/rspack/common-libs/lib1/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lib1",
3 | "version": "1.0.0",
4 | "main": "dist/index.js",
5 | "scripts": {
6 | "build": "tsc"
7 | },
8 | "license": "MIT"
9 | }
10 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib1/src/components/tab.ts:
--------------------------------------------------------------------------------
1 | export const tab = 'tab';
2 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib1/src/index.ts:
--------------------------------------------------------------------------------
1 | import { tab } from '@components/tab';
2 | console.log('button', tab);
3 | export * from '@components/tab';
4 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib1/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "dist",
5 | "rootDir": "src",
6 | "paths": {
7 | "@components/*": ["./src/components/*"]
8 | }
9 | },
10 | "include": ["src"]
11 | }
12 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lib2",
3 | "version": "1.0.0",
4 | "main": "dist/index.js",
5 | "scripts": {
6 | "build": "tsc"
7 | },
8 | "license": "MIT"
9 | }
10 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib2/src/components/button.ts:
--------------------------------------------------------------------------------
1 | export const button = 'button';
2 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib2/src/index.ts:
--------------------------------------------------------------------------------
1 | import { button } from '@components/button';
2 | console.log('button', button);
3 | export * from '@components/button';
4 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib2/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "dist",
5 | "rootDir": "src",
6 | "paths": {
7 | "@components/*": ["./src/components/*"]
8 | }
9 | },
10 | "include": ["src"]
11 | }
12 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib3/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "lib3",
3 | "version": "1.0.0",
4 | "main": "src/index.js",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1"
7 | },
8 | "license": "MIT"
9 | }
10 |
--------------------------------------------------------------------------------
/rspack/common-libs/lib3/src/index.js:
--------------------------------------------------------------------------------
1 | export async function answer() {
2 | return 42;
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/cra-ts/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/cra-ts/public/favicon.ico
--------------------------------------------------------------------------------
/rspack/cra-ts/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/cra-ts/public/logo192.png
--------------------------------------------------------------------------------
/rspack/cra-ts/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/cra-ts/public/logo512.png
--------------------------------------------------------------------------------
/rspack/cra-ts/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/rspack/cra-ts/src/App.test.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render, screen } from '@testing-library/react';
3 | import App from './App';
4 |
5 | test('renders learn react link', () => {
6 | render();
7 | const linkElement = screen.getByText(/learn react/i);
8 | expect(linkElement).toBeInTheDocument();
9 | });
10 |
--------------------------------------------------------------------------------
/rspack/cra-ts/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/rspack/cra-ts/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/rspack/cra/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/cra/public/favicon.ico
--------------------------------------------------------------------------------
/rspack/cra/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/cra/public/logo192.png
--------------------------------------------------------------------------------
/rspack/cra/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/cra/public/logo512.png
--------------------------------------------------------------------------------
/rspack/cra/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/rspack/cra/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render();
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/rspack/cra/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/rspack/css-parser-generator-options/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/css-parser-generator-options/src/global.css:
--------------------------------------------------------------------------------
1 | #root {
2 | font-size: large;
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/css-parser-generator-options/src/index.js:
--------------------------------------------------------------------------------
1 | import './global.css';
2 | import * as classes from './style.module.scss';
3 | import legacyClasses from './legacy/index.css';
4 |
5 | function render() {
6 | document.getElementById('root').innerHTML = `
7 | container main
8 | legacy main
9 | `;
10 | }
11 |
12 | render();
13 |
--------------------------------------------------------------------------------
/rspack/css-parser-generator-options/src/legacy/index.css:
--------------------------------------------------------------------------------
1 | .legacy-main {
2 | color: blue;
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/css-parser-generator-options/src/style.module.scss:
--------------------------------------------------------------------------------
1 | .container-main {
2 | color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/dll-reference/index.js:
--------------------------------------------------------------------------------
1 | import a from '../dll/a';
2 | import alpha from '../dll/alpha';
3 | import beta from 'beta/beta'
4 | import b from 'beta/b'
5 | import c from 'beta/c'
6 | import _ from 'lodash';
7 |
8 |
9 | console.log(a)
10 | console.log(alpha)
11 | console.log(beta)
12 | console.log(b)
13 | console.log(c)
14 | console.log(_.sum([1, 2]))
--------------------------------------------------------------------------------
/rspack/dll-reference/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-dll-reference-plugin",
3 | "private": true,
4 | "scripts": {
5 | "dev": "rspack serve",
6 | "build": "rspack build || echo 'make-ci-happy'"
7 | },
8 | "devDependencies": {
9 | "@rspack/cli": "1.3.15",
10 | "@rspack/core": "1.3.15",
11 | "lodash": "4.17.21",
12 | "typescript": "^5.8.3"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rspack/dll/a.ts:
--------------------------------------------------------------------------------
1 | export default "a";
--------------------------------------------------------------------------------
/rspack/dll/alpha.ts:
--------------------------------------------------------------------------------
1 | export default "alpha";
--------------------------------------------------------------------------------
/rspack/dll/b.ts:
--------------------------------------------------------------------------------
1 | export default "b";
--------------------------------------------------------------------------------
/rspack/dll/beta.ts:
--------------------------------------------------------------------------------
1 | export default "beta"
--------------------------------------------------------------------------------
/rspack/dll/c.tsx:
--------------------------------------------------------------------------------
1 | export default "c.tsx";
2 |
--------------------------------------------------------------------------------
/rspack/dll/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-dll-plugin",
3 | "private": true,
4 | "scripts": {
5 | "dev": "rspack serve",
6 | "build": "rspack build || echo 'make-ci-happy'"
7 | },
8 | "dependencies": {
9 | "lodash": "4.17.21"
10 | },
11 | "devDependencies": {
12 | "@rspack/cli": "1.3.15",
13 | "@rspack/core": "1.3.15",
14 | "typescript": "^5.8.3"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rspack/emotion/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/eslint/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | es2021: true,
4 | browser: true,
5 | },
6 | extends: 'eslint:recommended',
7 | overrides: [],
8 | parserOptions: {
9 | ecmaVersion: 'latest',
10 | sourceType: 'module',
11 | },
12 | rules: {},
13 | };
14 |
--------------------------------------------------------------------------------
/rspack/eslint/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/eslint/rspack.config.js:
--------------------------------------------------------------------------------
1 | const EslintPlugin = require('eslint-rspack-plugin');
2 | /** @type {import('@rspack/cli').Configuration} */
3 | const config = {
4 | context: __dirname,
5 | entry: {
6 | main: './src/index.js',
7 | },
8 | plugins: [new EslintPlugin()],
9 | };
10 | module.exports = config;
11 |
--------------------------------------------------------------------------------
/rspack/eslint/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/eslint/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/express/src/api/root.ts:
--------------------------------------------------------------------------------
1 | export function rootHandler(req, res) {
2 | res.send('Hello Rspack');
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/extract-license/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/generate-package-json-webpack-plugin@2/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-generate-package-json-webpack-plugin_2",
3 | "private": true,
4 | "scripts": {
5 | "build": "rspack build"
6 | },
7 | "devDependencies": {
8 | "@rspack/cli": "1.3.15",
9 | "@rspack/core": "1.3.15",
10 | "generate-package-json-webpack-plugin": "^2.6.0"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rspack/generate-package-json-webpack-plugin@2/src/index.js:
--------------------------------------------------------------------------------
1 | function main() {
2 | return 'hello world';
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/hooks/after-resolve/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/hooks/after-resolve/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/hooks/after-resolve/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/html-webpack-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Document
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/rspack/html-webpack-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-html-webpack-plugin_5",
3 | "private": true,
4 | "scripts": {
5 | "dev": "rspack serve",
6 | "build": "rspack build"
7 | },
8 | "devDependencies": {
9 | "@rspack/cli": "1.3.15",
10 | "@rspack/core": "1.3.15",
11 | "html-webpack-plugin": "^5.6.3"
12 | },
13 | "rspack": {
14 | "version": ">=0.3.11"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rspack/html-webpack-plugin/rspack.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@rspack/cli');
2 | const HtmlWebpackPlugin = require('html-webpack-plugin');
3 |
4 | module.exports = defineConfig({
5 | plugins: [
6 | new HtmlWebpackPlugin({
7 | template: './index.html',
8 | }),
9 | ],
10 | });
11 |
--------------------------------------------------------------------------------
/rspack/html-webpack-plugin/src/index.js:
--------------------------------------------------------------------------------
1 | function main() {
2 | return 'hello world';
3 | }
4 |
5 | console.log(main());
6 |
--------------------------------------------------------------------------------
/rspack/http-import/.gitignore:
--------------------------------------------------------------------------------
1 | http-import.lock.data/
--------------------------------------------------------------------------------
/rspack/http-import/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/http-import/src/index.js:
--------------------------------------------------------------------------------
1 | import answer from 'https://www.unpkg.com/the-answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/lazy-compilation-server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-use-custom-server-for-lazy-compilation",
3 | "private": true,
4 | "scripts": {
5 | "dev": "node ./dev.js"
6 | },
7 | "devDependencies": {
8 | "@rspack/core": "1.3.15",
9 | "@rspack/dev-server": "1.1.3"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/rspack/lazy-compilation-server/src/index.js:
--------------------------------------------------------------------------------
1 | import info from './info';
2 |
3 | const text = document.createElement('text');
4 |
5 | text.textContent = info;
6 |
7 | document.body.appendChild(text);
8 |
9 | document.addEventListener('click', () => {
10 | import('./show-msg');
11 | });
12 |
13 | module.hot.accept('./info', () => {
14 | text.textContent = info;
15 | });
16 |
--------------------------------------------------------------------------------
/rspack/lazy-compilation-server/src/info.js:
--------------------------------------------------------------------------------
1 | export default 2;
2 |
--------------------------------------------------------------------------------
/rspack/lazy-compilation-server/src/show-msg.js:
--------------------------------------------------------------------------------
1 | alert('hello');
2 |
--------------------------------------------------------------------------------
/rspack/library-cjs/README.md:
--------------------------------------------------------------------------------
1 | # CJS Library
2 |
3 | build cjs library
--------------------------------------------------------------------------------
/rspack/library-cjs/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/library-cjs/src/index.js:
--------------------------------------------------------------------------------
1 | export * from './answer';
2 | export * from './secret';
3 |
--------------------------------------------------------------------------------
/rspack/library-cjs/src/secret.js:
--------------------------------------------------------------------------------
1 | export const secret = 'rspack';
2 |
--------------------------------------------------------------------------------
/rspack/library-esm/README.md:
--------------------------------------------------------------------------------
1 | # ESM Library
2 |
3 | build esm library
--------------------------------------------------------------------------------
/rspack/library-esm/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/library-esm/src/index.js:
--------------------------------------------------------------------------------
1 | export * from './answer';
2 | export * from './secret';
3 |
--------------------------------------------------------------------------------
/rspack/library-esm/src/secret.js:
--------------------------------------------------------------------------------
1 | export const secret = 'rspack';
2 |
--------------------------------------------------------------------------------
/rspack/library-umd/README.md:
--------------------------------------------------------------------------------
1 | # UMD Library
2 |
3 | build umd library
--------------------------------------------------------------------------------
/rspack/library-umd/rspack.config.mjs:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "@rspack/cli";
2 |
3 | export default defineConfig({
4 | mode: "production",
5 | entry: {
6 | index: "./src/index.js",
7 | },
8 | output: {
9 | library: {
10 | type: "umd",
11 | name: 'rspack_library'
12 | },
13 | },
14 | optimization: {
15 | minimize: false, // no need to minify for library
16 | },
17 | });
18 |
--------------------------------------------------------------------------------
/rspack/library-umd/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/library-umd/src/index.js:
--------------------------------------------------------------------------------
1 | export * from './answer';
2 | export * from './secret';
3 |
--------------------------------------------------------------------------------
/rspack/library-umd/src/secret.js:
--------------------------------------------------------------------------------
1 | export const secret = 'rspack';
2 |
--------------------------------------------------------------------------------
/rspack/license-webpack-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-license-webpack-plugin_4",
3 | "private": true,
4 | "scripts": {
5 | "build": "rspack build"
6 | },
7 | "devDependencies": {
8 | "@rspack/cli": "1.3.15",
9 | "@rspack/core": "1.3.15",
10 | "license-webpack-plugin": "^4.0.2",
11 | "react": "^19.1.0",
12 | "react-dom": "^19.1.0"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rspack/lightingcss-loader/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/lightingcss-loader/src/answer.css:
--------------------------------------------------------------------------------
1 | .universe {
2 | .answer {
3 | color: red;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/rspack/lightingcss-loader/src/answer.js:
--------------------------------------------------------------------------------
1 | import './answer.css';
2 | export const answer = 42;
3 |
--------------------------------------------------------------------------------
/rspack/lightingcss-loader/src/index.css:
--------------------------------------------------------------------------------
1 | .universe {
2 | color: color-mix(in hsl, hsl(120deg 10% 20%) 25%, hsl(30deg 30% 40%));
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/lightingcss-loader/src/index.js:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import { answer } from './answer';
3 | function render() {
4 | document.getElementById('root').innerHTML =
5 | `the answer to the universe is ${answer}
`;
6 | }
7 | render();
8 |
--------------------------------------------------------------------------------
/rspack/loader-compat/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/loader-compat/src/a.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/loader-compat/src/b.less:
--------------------------------------------------------------------------------
1 | @width: 10px;
2 | @height: @width + 10px;
3 | @bg-color: #f00;
4 | #header {
5 | width: @width;
6 | height: @height;
7 | background-color: @bg-color;
8 | }
9 |
--------------------------------------------------------------------------------
/rspack/loader-compat/src/c.scss:
--------------------------------------------------------------------------------
1 | $font-stack: Helvetica, sans-serif;
2 | $primary-color: #333;
3 |
4 | body {
5 | font: 100% $font-stack;
6 | color: $primary-color;
7 | background-color: $primary-color;
8 | }
9 |
--------------------------------------------------------------------------------
/rspack/loader-compat/src/d.yaml:
--------------------------------------------------------------------------------
1 | name: Rspack
2 | features:
3 | bundle_splitting:
4 | split_chunks: node_modules
5 | tree_shaking:
6 | usec_exports
--------------------------------------------------------------------------------
/rspack/loader-compat/src/e.styl:
--------------------------------------------------------------------------------
1 | vendor(prop, args)
2 | -webkit-{prop} args
3 | -moz-{prop} args
4 | {prop} args
5 |
6 | border-radius()
7 | vendor('border-radius', arguments)
8 |
9 | box-shadow()
10 | vendor('box-shadow', arguments)
11 |
12 | button
13 | border-radius 1px 2px / 3px 4px
--------------------------------------------------------------------------------
/rspack/loader-compat/src/f.js:
--------------------------------------------------------------------------------
1 | const a = () => {
2 | console.log('xxx');
3 | };
4 |
--------------------------------------------------------------------------------
/rspack/loader-compat/src/g.md:
--------------------------------------------------------------------------------
1 | # Rspack Loader Support
2 | # H1
3 | ## H2
4 | ### H3
5 | **bold text**
6 | *italicized text*
7 | > blockquote
8 | 1. First item
9 | 2. Second item
10 | 3. Third item
11 | Unordered List
12 | - First item
13 | - Second item
14 | - Third item
15 | Code `code`
16 | Horizontal Rule ---
17 | Link [title](https://www.example.com)
18 | Image 
--------------------------------------------------------------------------------
/rspack/loader-compat/src/h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/loader-compat/src/h.png
--------------------------------------------------------------------------------
/rspack/loader-compat/src/j.txt:
--------------------------------------------------------------------------------
1 | hello rspack
--------------------------------------------------------------------------------
/rspack/loader-compat/src/k.ts:
--------------------------------------------------------------------------------
1 | let a = 10;
2 |
--------------------------------------------------------------------------------
/rspack/loader-compat/src/l.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/loader-compat/src/l.png
--------------------------------------------------------------------------------
/rspack/minify-test/a.js:
--------------------------------------------------------------------------------
1 | module.exports = 'a';
2 |
--------------------------------------------------------------------------------
/rspack/minify-test/a2.js:
--------------------------------------------------------------------------------
1 | module.exports = 'a2';
2 |
--------------------------------------------------------------------------------
/rspack/minify-test/b.js:
--------------------------------------------------------------------------------
1 | module.exports = 'b';
2 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/README.md:
--------------------------------------------------------------------------------
1 | # module-federation-interop
2 |
3 | This is the example shows different project using different module federation implementation (Rspack module federation v1, Rspack module federation v1.5 and webpack module federation), and interop with each other.
4 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/rspack-mf-v1.5/src/Component.js:
--------------------------------------------------------------------------------
1 | const Component = () => (
2 |
3 |
4 | I'm a Component exposed from container: Rspack MF v1.5!
5 |
6 |
7 | );
8 | export default Component;
9 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/rspack-mf-v1.5/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/rspack-mf-v1.5/src/runtimePlugins/logger.js:
--------------------------------------------------------------------------------
1 | export default function () {
2 | return {
3 | name: 'logger',
4 | beforeInit(args) {
5 | console.log('beforeInit: ', args);
6 | return args;
7 | },
8 | beforeLoadShare(args) {
9 | console.log('beforeLoadShare: ', args);
10 | return args;
11 | },
12 | };
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/rspack-mf-v1/src/Component.js:
--------------------------------------------------------------------------------
1 | const Component = () => (
2 |
3 |
4 | I'm a Component exposed from container: Rspack MF v1!
5 |
6 |
7 | );
8 | export default Component;
9 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/rspack-mf-v1/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/webpack-mf/src/Component.js:
--------------------------------------------------------------------------------
1 | const Component = () => (
2 |
3 |
4 | I'm a Component exposed from container: Webpack MF!
5 |
6 |
7 | );
8 | export default Component;
9 |
--------------------------------------------------------------------------------
/rspack/module-federation-interop/webpack-mf/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1.5/app/src/bootstrap.js:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client'; // <- this is a shared module, but used as usual
2 | import App from './App';
3 |
4 | // load app
5 | const el = document.createElement('main');
6 | const root = createRoot(el);
7 | root.render();
8 | document.body.appendChild(el);
9 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1.5/app/src/runtimePlugins/logger.js:
--------------------------------------------------------------------------------
1 | export default function () {
2 | return {
3 | name: 'logger',
4 | beforeInit(args) {
5 | console.log('beforeInit: ', args);
6 | return args;
7 | },
8 | beforeLoadShare(args) {
9 | console.log('beforeLoadShare: ', args);
10 | return args;
11 | },
12 | };
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1.5/lib1/src/bootstrap.js:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client';
2 | import Component from './Component';
3 | import { de } from 'date-fns/locale';
4 |
5 | const el = document.createElement('main');
6 | const root = createRoot(el);
7 | root.render(
8 |
9 |
Lib 1
10 |
11 | ,
12 | );
13 | document.body.appendChild(el);
14 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1.5/lib1/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1/app/src/bootstrap.js:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client'; // <- this is a shared module, but used as usual
2 | import App from './App';
3 |
4 | // load app
5 | const el = document.createElement('main');
6 | const root = createRoot(el);
7 | root.render();
8 | document.body.appendChild(el);
9 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1/lib1/src/bootstrap.js:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client';
2 | import Component from './Component';
3 | import { de } from 'date-fns/locale';
4 |
5 | const el = document.createElement('main');
6 | const root = createRoot(el);
7 | root.render(
8 |
9 |
Lib 1
10 |
11 | ,
12 | );
13 | document.body.appendChild(el);
14 |
--------------------------------------------------------------------------------
/rspack/module-federation-v1/lib1/src/index.js:
--------------------------------------------------------------------------------
1 | import('./bootstrap');
2 |
--------------------------------------------------------------------------------
/rspack/monaco-editor-js/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/rspack/monaco-editor-ts-react/src/index.css:
--------------------------------------------------------------------------------
1 | .Editor {
2 | width: 800px;
3 | height: 600px;
4 | border: 1px solid #ccc;
5 | }
6 |
--------------------------------------------------------------------------------
/rspack/monaco-editor-ts-react/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Monaco Editor Sample
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/rspack/monaco-editor-ts-react/src/index.tsx:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | import { Editor } from './components/Editor';
3 |
4 | import React from 'react';
5 | import ReactDOM from 'react-dom/client';
6 | import './index.css';
7 |
8 | const root = ReactDOM.createRoot(document.getElementById('root')!);
9 | root.render(
10 |
11 |
12 | ,
13 | );
14 |
--------------------------------------------------------------------------------
/rspack/multi-entry/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/multi-entry/index.js:
--------------------------------------------------------------------------------
1 | import { something } from './static';
2 | const a = 10;
3 | async function render() {
4 | import('./answer').then((x) => {
5 | console.log('x:', x);
6 | });
7 | console.log('a:', a);
8 | console.log('static:', something);
9 | document.getElementById('root').innerHTML = a;
10 | }
11 |
12 | render();
13 |
--------------------------------------------------------------------------------
/rspack/multi-entry/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-multi-entry",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "rspack build",
9 | "dev": "rspack serve"
10 | },
11 | "devDependencies": {
12 | "@rspack/cli": "1.3.15",
13 | "@rspack/core": "1.3.15"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rspack/multi-entry/second.js:
--------------------------------------------------------------------------------
1 | console.log('second');
2 |
--------------------------------------------------------------------------------
/rspack/multi-entry/static.js:
--------------------------------------------------------------------------------
1 | export const something = 'static';
2 |
--------------------------------------------------------------------------------
/rspack/nest-alias/rspack.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@rspack/cli');
2 | const path = require('path');
3 | module.exports = defineConfig({
4 | entry: {
5 | main: './src/index.ts',
6 | },
7 | resolve: {
8 | tsConfig: {
9 | references: 'auto',
10 | configFile: path.resolve(__dirname, './tsconfig.json'),
11 | },
12 | },
13 | });
14 |
--------------------------------------------------------------------------------
/rspack/nest-alias/src/index.ts:
--------------------------------------------------------------------------------
1 | import { tab } from 'lib1';
2 | import { button } from 'lib2';
3 |
4 | console.log('tab:', tab, button);
5 |
--------------------------------------------------------------------------------
/rspack/nest-alias/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "outDir": "dist",
5 | "rootDir": "src"
6 | },
7 | "include": ["src"],
8 | "references": [
9 | {
10 | "path": "../common-libs/lib1"
11 | },
12 | {
13 | "path": "../common-libs/lib2"
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/rspack/nestjs/README.md:
--------------------------------------------------------------------------------
1 |
2 | # NestJS Example
3 |
4 | ```js
5 | pnpm run build
6 | pnpm run start
7 | ```
--------------------------------------------------------------------------------
/rspack/nestjs/src/app.controller.ts:
--------------------------------------------------------------------------------
1 | import { Controller, Get } from '@nestjs/common';
2 | import { AppService } from './app.service';
3 |
4 | @Controller()
5 | export class AppController {
6 | constructor(private readonly appService: AppService) {}
7 |
8 | @Get()
9 | getHello(): string {
10 | return this.appService.getHello();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rspack/nestjs/src/app.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { AppController } from './app.controller';
3 | import { AppService } from './app.service';
4 |
5 | @Module({
6 | imports: [],
7 | controllers: [AppController],
8 | providers: [AppService],
9 | })
10 | export class AppModule {}
11 |
--------------------------------------------------------------------------------
/rspack/nestjs/src/app.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 |
3 | @Injectable()
4 | export class AppService {
5 | getHello(): string {
6 | return 'Hello World!';
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/rspack/nestjs/src/main.ts:
--------------------------------------------------------------------------------
1 | declare const module: any;
2 |
3 | import { NestFactory } from '@nestjs/core';
4 | import { AppModule } from './app.module';
5 |
6 | async function bootstrap() {
7 | const app = await NestFactory.create(AppModule);
8 | await app.listen(3000);
9 | if (module.hot) {
10 | module.hot.accept();
11 | module.hot.dispose(() => app.close());
12 | }
13 | }
14 | bootstrap();
15 |
--------------------------------------------------------------------------------
/rspack/next-rspack-app-router/README.md:
--------------------------------------------------------------------------------
1 | # Next-Rspack-App-Router
--------------------------------------------------------------------------------
/rspack/next-rspack-app-router/app/page.tsx:
--------------------------------------------------------------------------------
1 | export default function Home() {
2 | return Hello World
;
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/next-rspack-app-router/next.config.js:
--------------------------------------------------------------------------------
1 | const withRspack = require('next-rspack');
2 |
3 | /** @type {import('next').NextConfig} */
4 | const nextConfig = {
5 | /* config options here */
6 | };
7 |
8 | module.exports = withRspack(nextConfig);
9 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/README.md:
--------------------------------------------------------------------------------
1 | # Next-Rspack-Page-Router
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/next.config.js:
--------------------------------------------------------------------------------
1 | const withRspack = require('next-rspack');
2 |
3 | /** @type {import('next').NextConfig} */
4 | const nextConfig = {
5 | /* config options here */
6 | };
7 |
8 | module.exports = withRspack(nextConfig);
9 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import '@/styles/globals.css';
2 | import type { AppProps } from 'next/app';
3 |
4 | export default function App({ Component, pageProps }: AppProps) {
5 | return ;
6 | }
7 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import { Html, Head, Main, NextScript } from 'next/document';
2 |
3 | export default function Document() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/pages/api/hello.ts:
--------------------------------------------------------------------------------
1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 | import type { NextApiRequest, NextApiResponse } from 'next';
3 |
4 | type Data = {
5 | name: string;
6 | };
7 |
8 | export default function handler(req: NextApiRequest, res: NextApiResponse) {
9 | res.status(200).json({ name: 'John Doe' });
10 | }
11 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/next-rspack-page-router/public/favicon.ico
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/public/file.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rspack/next-rspack-page-router/public/window.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rspack/node-globals-shim/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/node-globals-shim/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/node-globals-shim/src/index.js:
--------------------------------------------------------------------------------
1 | import './util';
2 | import { answer } from './answer';
3 | function render() {
4 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
5 | }
6 | render();
7 |
--------------------------------------------------------------------------------
/rspack/node-globals-shim/src/process-shim.js:
--------------------------------------------------------------------------------
1 | var process = {};
2 |
--------------------------------------------------------------------------------
/rspack/node-globals-shim/src/util.js:
--------------------------------------------------------------------------------
1 | console.log('process:', process);
2 |
--------------------------------------------------------------------------------
/rspack/node-polyfill/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/node-polyfill/src/index.js:
--------------------------------------------------------------------------------
1 | const util = require('util');
2 | const logger = require('./logger');
3 | console.log('procss:', process.version);
4 | console.log('buffer', Buffer.from('abcd'));
5 | console.log('util:', util.format('%s:%s', 'foo', 'bar'));
6 | logger('log', 'logger');
7 |
--------------------------------------------------------------------------------
/rspack/node-polyfill/src/logger.js:
--------------------------------------------------------------------------------
1 | module.exports = function logger(method, ...args) {
2 | console[method](...args);
3 | };
4 |
--------------------------------------------------------------------------------
/rspack/perfsee/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/perfsee/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/perfsee/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/polyfill/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/polyfill/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/polyfill/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/postcss-loader/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/postcss-loader/src/index.css:
--------------------------------------------------------------------------------
1 | .example {
2 | display: grid;
3 | transition: all 0.5s;
4 | user-select: none;
5 | height: 100px;
6 | background: linear-gradient(to bottom, white, black);
7 | }
8 |
--------------------------------------------------------------------------------
/rspack/postcss-loader/src/index.js:
--------------------------------------------------------------------------------
1 | import './index.css';
2 | function render() {
3 | document.getElementById('root').innerHTML =
4 | `the answer to the universe is 42
`;
5 | }
6 | render();
7 |
--------------------------------------------------------------------------------
/rspack/preact-refresh/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/preact-refresh/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render();
8 |
9 | if (module.hot) {
10 | module.hot.accept();
11 | }
12 |
--------------------------------------------------------------------------------
/rspack/preact/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/preact/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render();
8 |
--------------------------------------------------------------------------------
/rspack/proxy/index.js:
--------------------------------------------------------------------------------
1 | console.log('test');
2 |
--------------------------------------------------------------------------------
/rspack/proxy/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-proxy",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "rspack build",
9 | "dev": "rspack serve"
10 | },
11 | "devDependencies": {
12 | "@rspack/cli": "1.3.15",
13 | "@rspack/core": "1.3.15"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel-ts/babel.config.js:
--------------------------------------------------------------------------------
1 | // babel.config.js
2 | const ReactCompilerConfig = {
3 | /* ... */
4 | };
5 |
6 | module.exports = {
7 | plugins: [
8 | ['babel-plugin-react-compiler', ReactCompilerConfig], // must run first!
9 | '@babel/plugin-syntax-jsx',
10 | ['@babel/plugin-syntax-typescript', { isTSX: true }],
11 | ],
12 | };
13 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel-ts/src/env.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Image assets
3 | */
4 | declare module '*.svg' {
5 | const src: string;
6 | export default src;
7 | }
8 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel-ts/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root')!);
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel/babel.config.js:
--------------------------------------------------------------------------------
1 | // babel.config.js
2 | const ReactCompilerConfig = {
3 | /* ... */
4 | };
5 |
6 | module.exports = {
7 | plugins: [
8 | ['babel-plugin-react-compiler', ReactCompilerConfig], // must run first!
9 | '@babel/plugin-syntax-jsx',
10 | ],
11 | };
12 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/react-compiler-babel/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/ArrowFunction.tsx:
--------------------------------------------------------------------------------
1 | export const ArrowFunction = () => Arrow Function
;
2 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/ClassDefault.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from 'react';
2 |
3 | class ClassDefault extends Component {
4 | render() {
5 | return Default Export Class
;
6 | }
7 | }
8 |
9 | export default ClassDefault;
10 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/ClassNamed.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from 'react';
2 |
3 | export class ClassNamed extends Component {
4 | render() {
5 | return Named Export Class
;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/FunctionDefault.tsx:
--------------------------------------------------------------------------------
1 | function FunctionDefault() {
2 | return Default Export Function
;
3 | }
4 |
5 | export default FunctionDefault;
6 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/FunctionNamed.tsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 |
3 | export function FunctionNamed() {
4 | const [data, setData] = useState(0);
5 |
6 | useEffect(() => {
7 | setInterval(() => {
8 | setData((i) => i + 1);
9 | }, 100);
10 | }, []);
11 |
12 | return Named Export Function {data}
;
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/LazyComponent.tsx:
--------------------------------------------------------------------------------
1 | function LazyComponent() {
2 | return Lazy Component
;
3 | }
4 |
5 | export default LazyComponent;
6 |
--------------------------------------------------------------------------------
/rspack/react-refresh-babel-loader/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client';
2 | import App from './App';
3 |
4 | const container = document.getElementById('root');
5 | const root = createRoot(container!);
6 | root.render();
7 |
--------------------------------------------------------------------------------
/rspack/react-refresh/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/ArrowFunction.tsx:
--------------------------------------------------------------------------------
1 | export const ArrowFunction = () => Arrow Function
;
2 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/ClassDefault.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from 'react';
2 |
3 | class ClassDefault extends Component {
4 | render() {
5 | return Default Export Class
;
6 | }
7 | }
8 |
9 | export default ClassDefault;
10 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/ClassNamed.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from 'react';
2 |
3 | export class ClassNamed extends Component {
4 | render() {
5 | return Named Export Class
;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/FunctionDefault.tsx:
--------------------------------------------------------------------------------
1 | function FunctionDefault() {
2 | return Default Export Function
;
3 | }
4 |
5 | export default FunctionDefault;
6 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/FunctionNamed.tsx:
--------------------------------------------------------------------------------
1 | import { useEffect, useState } from 'react';
2 |
3 | export function FunctionNamed() {
4 | const [data, setData] = useState(0);
5 |
6 | useEffect(() => {
7 | setInterval(() => {
8 | setData((i) => i + 1);
9 | }, 100);
10 | }, []);
11 |
12 | return Named Export Function {data}
;
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/LazyComponent.tsx:
--------------------------------------------------------------------------------
1 | function LazyComponent() {
2 | return Lazy Component
;
3 | }
4 |
5 | export default LazyComponent;
6 |
--------------------------------------------------------------------------------
/rspack/react-refresh/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client';
2 | import App from './App';
3 |
4 | const container = document.getElementById('root');
5 | const root = createRoot(container!);
6 | root.render();
7 |
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | React with Css Extract Example
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/src/components/hello-world.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import styles from './index.module.less';
3 |
4 | export default function HelloWorld() {
5 | return Hello World, I am being styled using Less!
;
6 | }
7 |
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/src/components/index.module.less:
--------------------------------------------------------------------------------
1 | @import '../style/themes/index.less';
2 |
3 | .hello {
4 | color: @color;
5 | }
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './styles.less';
4 | import HelloWorld from './components/hello-world';
5 |
6 | function App() {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 |
14 | ReactDOM.render(, document.getElementById('root'));
15 |
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/src/style/themes/default.less:
--------------------------------------------------------------------------------
1 | @color: yellow;
2 |
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/src/style/themes/index.less:
--------------------------------------------------------------------------------
1 | @import './default.less';
2 |
--------------------------------------------------------------------------------
/rspack/react-with-extract-css/src/styles.less:
--------------------------------------------------------------------------------
1 | @import 'normalize.css';
2 | @import './style/themes/default';
3 | @import './style/themes/index.less';
4 | @import 'style/themes/index.less';
5 | @import 'style/themes/default';
6 | @backgroundColor: #2ecc71;
7 |
8 | .app {
9 | background-color: @backgroundColor;
10 | }
--------------------------------------------------------------------------------
/rspack/react-with-less/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | React with Sass Example
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/react-with-less/src/components/hello-world.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import './index.less';
3 |
4 | export default function HelloWorld() {
5 | return Hello World, I am being styled using Less!
;
6 | }
7 |
--------------------------------------------------------------------------------
/rspack/react-with-less/src/components/index.less:
--------------------------------------------------------------------------------
1 | @import '../style/themes/index.less';
2 |
3 | .hello {
4 | color: @color;
5 | }
--------------------------------------------------------------------------------
/rspack/react-with-less/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './styles.less';
4 | import HelloWorld from './components/hello-world';
5 |
6 | function App() {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 |
14 | ReactDOM.render(, document.getElementById('root'));
15 |
--------------------------------------------------------------------------------
/rspack/react-with-less/src/style/themes/default.less:
--------------------------------------------------------------------------------
1 | @color: yellow;
2 |
--------------------------------------------------------------------------------
/rspack/react-with-less/src/style/themes/index.less:
--------------------------------------------------------------------------------
1 | @import './default.less';
2 |
--------------------------------------------------------------------------------
/rspack/react-with-less/src/styles.less:
--------------------------------------------------------------------------------
1 | @import 'normalize.css';
2 | @import './style/themes/default';
3 | @import './style/themes/index.less';
4 | @import 'style/themes/index.less';
5 | @import 'style/themes/default';
6 | @backgroundColor: #2ecc71;
7 |
8 | .app {
9 | background-color: @backgroundColor;
10 | }
--------------------------------------------------------------------------------
/rspack/react-with-sass/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | React with Sass Example
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/react-with-sass/src/components/hello-world.jsx:
--------------------------------------------------------------------------------
1 | import './hello-world.sass';
2 |
3 | export default function HelloWorld() {
4 | return Hello World, I am being styled using Sass!
;
5 | }
6 |
--------------------------------------------------------------------------------
/rspack/react-with-sass/src/components/hello-world.sass:
--------------------------------------------------------------------------------
1 | $color: red
2 |
3 | .hello
4 | color: $color
5 |
--------------------------------------------------------------------------------
/rspack/react-with-sass/src/index.jsx:
--------------------------------------------------------------------------------
1 | import ReactDOM from 'react-dom';
2 | import './styles.scss';
3 | import HelloWorld from './components/hello-world';
4 |
5 | function App() {
6 | return (
7 |
8 |
9 |
10 | );
11 | }
12 |
13 | ReactDOM.render(, document.getElementById('root'));
14 |
--------------------------------------------------------------------------------
/rspack/react-with-sass/src/styles.scss:
--------------------------------------------------------------------------------
1 | @import "./reset.css";
2 |
3 | $backgroundColor: #2ecc71;
4 |
5 | .app {
6 | background-color: $backgroundColor;
7 | }
8 |
--------------------------------------------------------------------------------
/rspack/react/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/react/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 | root.render(
8 |
9 |
10 | ,
11 | );
12 |
--------------------------------------------------------------------------------
/rspack/rspack-manifest-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-rspack-manifest-plugin_4",
3 | "private": true,
4 | "scripts": {
5 | "build": "rspack build",
6 | "test": "node ./test.js"
7 | },
8 | "devDependencies": {
9 | "@rspack/cli": "1.3.15",
10 | "@rspack/core": "1.3.15",
11 | "rspack-manifest-plugin": "5.0.3"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/rspack-manifest-plugin/src/index.js:
--------------------------------------------------------------------------------
1 | function main() {
2 | return 'hello world';
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/sentry/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/sentry/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/sentry/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/solid/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Solid.js Example
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/solid/src/Message.jsx:
--------------------------------------------------------------------------------
1 | export default function Message() {
2 | // Changing this won't affect the parent.
3 | return Hello, Solid
;
4 | }
5 |
--------------------------------------------------------------------------------
/rspack/solid/src/assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/solid/src/assets/favicon.ico
--------------------------------------------------------------------------------
/rspack/solid/src/index.jsx:
--------------------------------------------------------------------------------
1 | /* @refresh reload */
2 | import { render } from 'solid-js/web';
3 |
4 | import './index.css';
5 | import App from './App';
6 |
7 | render(() => , document.getElementById('root'));
8 |
--------------------------------------------------------------------------------
/rspack/source-map-with-vscode-debugging/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Source Map with VSCode Debugging
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/source-map-with-vscode-debugging/src/hello-world.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default function HelloWorld() {
4 | return Hello World!
;
5 | }
6 |
--------------------------------------------------------------------------------
/rspack/source-map-with-vscode-debugging/src/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import HelloWorld from './hello-world.jsx';
4 |
5 | function App() {
6 | return (
7 |
8 |
9 |
10 | );
11 | }
12 |
13 | ReactDOM.render(, document.getElementById('root'));
14 |
--------------------------------------------------------------------------------
/rspack/stats/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/stats/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-stats",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "sideEffects": ["**/*.css", "**/*.less", "**/*.scss"],
7 | "main": "index.js",
8 | "scripts": {
9 | "build": "rspack build",
10 | "dev": "rspack serve"
11 | },
12 | "devDependencies": {
13 | "@rspack/cli": "1.3.15",
14 | "@rspack/core": "1.3.15"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rspack/stats/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/stats/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/styled-components/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/svelte/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | dist
4 |
--------------------------------------------------------------------------------
/rspack/svelte/.postcssrc:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
--------------------------------------------------------------------------------
/rspack/svelte/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <%= htmlWebpackPlugin.options.title %>
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/rspack/svelte/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/svelte/public/favicon.png
--------------------------------------------------------------------------------
/rspack/svelte/src/Nested.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
--------------------------------------------------------------------------------
/rspack/svelte/src/main.ts:
--------------------------------------------------------------------------------
1 | import './global.css';
2 |
3 | import App from './App.svelte';
4 |
5 | const app = new App({
6 | target: document.body,
7 | props: {
8 | name: 'world',
9 | },
10 | });
11 |
12 | export default app;
13 |
--------------------------------------------------------------------------------
/rspack/svelte/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/svelte/tsconfig.json",
3 | "include": ["src/**/*", "src/node_modules/**/*"],
4 | "exclude": ["node_modules/*", "__sapper__/*", "static/*"],
5 | "compilerOptions": {
6 | "ignoreDeprecations": "5.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/rspack/svgr/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/svgr/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import { ReactComponent as Icon } from './logo.svg';
4 | console.log('icon:', Icon);
5 | ReactDOM.render(, document.getElementById('root'));
6 |
--------------------------------------------------------------------------------
/rspack/tailwind-jit/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/tailwind-jit/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/tailwind-jit/src/index.js:
--------------------------------------------------------------------------------
1 | import './main.css';
2 | import { answer } from './answer';
3 | function render() {
4 | document.getElementById('root').innerHTML =
5 | `the answer to the universe is ${answer}
`;
6 | }
7 | render();
8 |
--------------------------------------------------------------------------------
/rspack/tailwind-jit/src/main.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
--------------------------------------------------------------------------------
/rspack/tailwind-jit/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | mode: 'jit',
4 | content: ['./src/**/*.js'],
5 | theme: {
6 | extend: {},
7 | },
8 | plugins: [],
9 | };
10 |
--------------------------------------------------------------------------------
/rspack/tailwind/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/tailwind/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/tailwind/src/index.js:
--------------------------------------------------------------------------------
1 | import './main.css';
2 | import { answer } from './answer';
3 | function render() {
4 | document.getElementById('root').innerHTML =
5 | `the answer to the universe is ${answer}
`;
6 | }
7 | render();
8 |
--------------------------------------------------------------------------------
/rspack/tailwind/src/main.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
--------------------------------------------------------------------------------
/rspack/tailwind/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | const config = {
3 | content: ['src/**/*.js'],
4 | theme: {
5 | extend: {},
6 | },
7 | plugins: [],
8 | };
9 | module.exports = config;
10 |
--------------------------------------------------------------------------------
/rspack/terser-webpack-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-terser-webpack-plugin_5",
3 | "private": true,
4 | "scripts": {
5 | "build": "rspack build"
6 | },
7 | "devDependencies": {
8 | "@rspack/cli": "1.3.15",
9 | "@rspack/core": "1.3.15",
10 | "terser-webpack-plugin": "5.3.14"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rspack/terser-webpack-plugin/src/index.js:
--------------------------------------------------------------------------------
1 | function main() {
2 | return 'hello world';
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/treeshaking-transform-imports/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-treeshaking-transform-imports",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "rspack build",
9 | "dev": "rspack serve"
10 | },
11 | "devDependencies": {
12 | "@rspack/cli": "1.3.15",
13 | "@rspack/core": "1.3.15"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/rspack/treeshaking-transform-imports/src/a.js:
--------------------------------------------------------------------------------
1 | import { b } from './sdk';
2 | export const a = b;
3 |
--------------------------------------------------------------------------------
/rspack/treeshaking-transform-imports/src/b.js:
--------------------------------------------------------------------------------
1 | export const b = 1;
2 |
--------------------------------------------------------------------------------
/rspack/treeshaking-transform-imports/src/c.js:
--------------------------------------------------------------------------------
1 | export const c = 1;
2 |
--------------------------------------------------------------------------------
/rspack/treeshaking-transform-imports/src/index.js:
--------------------------------------------------------------------------------
1 | import { a } from './sdk';
2 | console.log(a);
3 |
--------------------------------------------------------------------------------
/rspack/treeshaking-transform-imports/src/sdk.js:
--------------------------------------------------------------------------------
1 | export { a } from './a';
2 | export { b } from './b';
3 | export { c } from './c';
4 |
--------------------------------------------------------------------------------
/rspack/ts-checker-rspack-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-ts-checker-rspack-plugin",
3 | "private": true,
4 | "scripts": {
5 | "dev": "rspack serve",
6 | "build": "rspack build || echo 'make-ci-happy'"
7 | },
8 | "devDependencies": {
9 | "@rspack/cli": "1.3.15",
10 | "@rspack/core": "1.3.15",
11 | "ts-checker-rspack-plugin": "^1.1.3",
12 | "typescript": "^5.8.3"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/rspack/ts-checker-rspack-plugin/src/index.ts:
--------------------------------------------------------------------------------
1 | function add(a: number, b: number): number {
2 | return a + b;
3 | }
4 |
5 | function main(): string {
6 | return 'hello world';
7 | }
8 |
9 | add(1, '1');
10 |
--------------------------------------------------------------------------------
/rspack/ts-checker-rspack-plugin/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "lib": ["ES2015"],
5 | "outDir": "dist",
6 | "noEmit": true
7 | },
8 | "include": ["src"]
9 | }
10 |
--------------------------------------------------------------------------------
/rspack/unplugin-auto-import/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/unplugin-auto-import/src/index.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './App.vue';
3 |
4 | createApp(App).mount('#app');
5 |
--------------------------------------------------------------------------------
/rspack/vanilla-extract-css/src/global.css.ts:
--------------------------------------------------------------------------------
1 | import { globalStyle } from '@vanilla-extract/css';
2 |
3 | globalStyle('body, body *', {
4 | all: 'unset',
5 | boxSizing: 'border-box',
6 | });
7 |
--------------------------------------------------------------------------------
/rspack/vanilla-extract-css/src/index.tsx:
--------------------------------------------------------------------------------
1 | import { createRoot } from 'react-dom/client';
2 | import './global.css';
3 | import { App } from './App';
4 |
5 | const root = document.createElement('div');
6 | document.body.appendChild(root);
7 |
8 | createRoot(root).render();
9 |
--------------------------------------------------------------------------------
/rspack/vue/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue/src/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import './style.css';
3 | import App from './App.vue';
4 | createApp(App).mount('#app');
5 |
--------------------------------------------------------------------------------
/rspack/vue2-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue2-ts/src/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import './style.css';
3 | import App from './App.vue';
4 |
5 | new Vue({
6 | el: '#app',
7 | render(h) {
8 | return h(App);
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/rspack/vue2-tsx/global.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue';
2 |
--------------------------------------------------------------------------------
/rspack/vue2-tsx/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue2-tsx/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspack/vue2-tsx/src/assets/logo.png
--------------------------------------------------------------------------------
/rspack/vue2-tsx/src/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import App from './App.vue';
3 | import './style.less';
4 |
5 | new Vue({
6 | el: '#app',
7 | render: (h) => h(App),
8 | });
9 |
--------------------------------------------------------------------------------
/rspack/vue2-tsx/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowJs": true,
4 | "jsx": "preserve",
5 | "isolatedModules": true,
6 | "typeRoots": ["node_modules/@types"]
7 | },
8 | "include": ["src/**/*.vue", "src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"]
9 | }
10 |
--------------------------------------------------------------------------------
/rspack/vue2/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue2/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import './style.css';
3 | import App from './App.vue';
4 |
5 | new Vue({
6 | el: '#app',
7 | render(h) {
8 | return h(App);
9 | },
10 | });
11 |
--------------------------------------------------------------------------------
/rspack/vue3-jsx/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue3-jsx/src/main.jsx:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './App';
3 | import './index.css';
4 |
5 | createApp(App).mount('#app');
6 |
--------------------------------------------------------------------------------
/rspack/vue3-tsx/global.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.svg';
2 | declare module '*.vue';
3 |
--------------------------------------------------------------------------------
/rspack/vue3-tsx/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue3-tsx/src/Button.vue:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 | setup tsx
9 |
10 |
11 |
--------------------------------------------------------------------------------
/rspack/vue3-tsx/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import App from './App';
3 | import './index.css';
4 |
5 | createApp(App).mount('#app');
6 |
--------------------------------------------------------------------------------
/rspack/vue3-tsx/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "jsx": "preserve",
4 | "isolatedModules": true,
5 | "typeRoots": ["node_modules/@types"]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/rspack/vue3-vanilla/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vue
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/rspack/vue3-vanilla/src/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue';
2 | import './style.css';
3 | import App from './App.vue';
4 | createApp(App).mount('#app');
5 |
--------------------------------------------------------------------------------
/rspack/wasm-simple/add.wasm:
--------------------------------------------------------------------------------
1 | asm ` add
2 | j
--------------------------------------------------------------------------------
/rspack/wasm-simple/factorial.wasm:
--------------------------------------------------------------------------------
1 | asm `
factorial
2 | AHA Ak l
--------------------------------------------------------------------------------
/rspack/wasm-simple/fibonacci.wasm:
--------------------------------------------------------------------------------
1 | asm `
fibonacci
2 | AHA Ak Ak j
--------------------------------------------------------------------------------
/rspack/wasm-simple/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-wasm-complex",
3 | "version": "1.0.0",
4 | "private": true,
5 | "license": "MIT",
6 | "main": "example.js",
7 | "scripts": {
8 | "build": "rspack build",
9 | "dev": "rspack serve"
10 | },
11 | "dependencies": {
12 | "@rspack/cli": "1.3.15"
13 | },
14 | "devDependencies": {
15 | "@rspack/core": "1.3.15"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/rspack/webpack-bundle-analyzer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-webpack-bundle-analyzer_4",
3 | "private": true,
4 | "scripts": {
5 | "dev": "rspack serve",
6 | "build": "rspack build"
7 | },
8 | "devDependencies": {
9 | "@rspack/cli": "1.3.15",
10 | "@rspack/core": "1.3.15",
11 | "webpack-bundle-analyzer": "^4.10.2"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/rspack/webpack-bundle-analyzer/rspack.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@rspack/cli');
2 | const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
3 |
4 | module.exports = defineConfig({
5 | plugins: [
6 | new BundleAnalyzerPlugin({
7 | analyzerMode: 'json',
8 | }),
9 | ],
10 | });
11 |
--------------------------------------------------------------------------------
/rspack/webpack-bundle-analyzer/src/index.js:
--------------------------------------------------------------------------------
1 | function main() {
2 | return 'hello world';
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/webpack-stats-plugin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example-webpack-stats-plugin",
3 | "private": true,
4 | "scripts": {
5 | "build": "rspack build"
6 | },
7 | "devDependencies": {
8 | "@rspack/cli": "1.3.15",
9 | "@rspack/core": "1.3.15",
10 | "webpack-stats-plugin": "^1.1.3"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/rspack/webpack-stats-plugin/rspack.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('@rspack/cli');
2 | const { StatsWriterPlugin } = require('webpack-stats-plugin');
3 |
4 | module.exports = defineConfig({
5 | plugins: [new StatsWriterPlugin()],
6 | });
7 |
--------------------------------------------------------------------------------
/rspack/webpack-stats-plugin/src/index.js:
--------------------------------------------------------------------------------
1 | function main() {
2 | return 'hello world';
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/workbox-webpack-plugin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/workbox-webpack-plugin/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/workbox-webpack-plugin/src/index.js:
--------------------------------------------------------------------------------
1 | import { answer } from './answer';
2 | function render() {
3 | document.getElementById('root').innerHTML = `the answer to the universe is ${answer}`;
4 | }
5 | render();
6 |
--------------------------------------------------------------------------------
/rspack/worker-inline/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/worker-inline/src/worker.js:
--------------------------------------------------------------------------------
1 | onmessage = function (event) {
2 | const workerResult = event.data;
3 |
4 | workerResult.onmessage = true;
5 |
6 | postMessage(workerResult);
7 | };
8 |
--------------------------------------------------------------------------------
/rspack/worker/chat-module.js:
--------------------------------------------------------------------------------
1 | export const history = [];
2 |
3 | export const add = (content, from) => {
4 | if (history.length > 10) history.shift();
5 | history.push(`${from}: ${content}`);
6 | };
7 |
--------------------------------------------------------------------------------
/rspack/worker/fib-worker.js:
--------------------------------------------------------------------------------
1 | onmessage = async (event) => {
2 | const { fibonacci } = await import('./fibonacci');
3 | const value = JSON.parse(event.data);
4 | postMessage(`fib(${value}) = ${fibonacci(value)}`);
5 | };
6 |
--------------------------------------------------------------------------------
/rspack/worker/fibonacci.js:
--------------------------------------------------------------------------------
1 | export function fibonacci(n) {
2 | return n < 1 ? 0 : n <= 2 ? 1 : fibonacci(n - 1) + fibonacci(n - 2);
3 | }
4 |
--------------------------------------------------------------------------------
/rspack/worker/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Worker example
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/rspack/worker/rspack.config.js:
--------------------------------------------------------------------------------
1 | const { rspack } = require('@rspack/core');
2 | const path = require('path');
3 |
4 | module.exports = {
5 | entry: './example.js',
6 | context: __dirname,
7 | output: {
8 | path: path.join(__dirname, 'dist'),
9 | },
10 | plugins: [
11 | new rspack.HtmlRspackPlugin({
12 | template: './index.html',
13 | }),
14 | ],
15 | };
16 |
--------------------------------------------------------------------------------
/rspack/worklet/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/rspack/worklet/loader/worklet-loader.js:
--------------------------------------------------------------------------------
1 | const esbuild = require('esbuild');
2 | module.exports = function workletLoader(source) {
3 | const result = esbuild.buildSync({
4 | entryPoints: [this.resource],
5 | write: false,
6 | bundle: true,
7 | });
8 | const content = result.outputFiles[0].text;
9 | return content;
10 | };
11 |
--------------------------------------------------------------------------------
/rspack/worklet/src/answer.js:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspack/worklet/src/lib.js:
--------------------------------------------------------------------------------
1 | export const a = 3;
2 |
--------------------------------------------------------------------------------
/rspack/worklet/src/worklet/answer.ts:
--------------------------------------------------------------------------------
1 | export const answer = 42;
2 |
--------------------------------------------------------------------------------
/rspress/basic/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 | doc_build
26 |
--------------------------------------------------------------------------------
/rspress/basic/docs/_meta.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "text": "Guide",
4 | "link": "/guide/",
5 | "activeMatch": "/guide/"
6 | },
7 | {
8 | "text": "Hello World",
9 | "link": "/hello/",
10 | "activeMatch": "/hello/"
11 | },
12 | {
13 | "text": "API",
14 | "link": "https://rspress.dev/api/index.html"
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/rspress/basic/docs/guide/_meta.json:
--------------------------------------------------------------------------------
1 | ["index"]
2 |
--------------------------------------------------------------------------------
/rspress/basic/docs/hello.md:
--------------------------------------------------------------------------------
1 | # Hello World!
2 |
3 | ## Start
4 |
5 | Write something to build your own docs! 🎁
6 |
--------------------------------------------------------------------------------
/rspress/basic/docs/public/rspress-dark-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspress/basic/docs/public/rspress-dark-logo.png
--------------------------------------------------------------------------------
/rspress/basic/docs/public/rspress-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspress/basic/docs/public/rspress-icon.png
--------------------------------------------------------------------------------
/rspress/basic/docs/public/rspress-light-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rspack-contrib/rstack-examples/dc3524a629ae38aab09190dca6506870eca89633/rspress/basic/docs/public/rspress-light-logo.png
--------------------------------------------------------------------------------
/rspress/basic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rspress-doc-template",
3 | "version": "1.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "rspress build",
7 | "dev": "rspress dev",
8 | "preview": "rspress preview"
9 | },
10 | "dependencies": {
11 | "rspress": "^1.44.0"
12 | },
13 | "devDependencies": {
14 | "@types/node": "^22.15.30"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/rspress/basic/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "jsx": "react-jsx",
4 | "esModuleInterop": true
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/rspress/custom-theme/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 | doc_build
26 |
--------------------------------------------------------------------------------
/rspress/custom-theme/docs/hello.md:
--------------------------------------------------------------------------------
1 | # Hello World!
2 |
3 | ## Start
4 |
5 | Write something to build your own docs! 🎁
6 |
--------------------------------------------------------------------------------
/rspress/custom-theme/rspress.config.ts:
--------------------------------------------------------------------------------
1 | import * as path from 'path';
2 | import { defineConfig } from 'rspress/config';
3 |
4 | export default defineConfig({
5 | root: path.join(__dirname, 'docs'),
6 | themeConfig: {
7 | footer: {
8 | createdBy: 'Rspress',
9 | } as any,
10 | },
11 | });
12 |
--------------------------------------------------------------------------------
/rspress/custom-theme/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "jsx": "react-jsx",
4 | "esModuleInterop": true
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/taze.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'taze';
2 |
3 | export default defineConfig({
4 | mode: 'major',
5 | include: ['/rspack/', '/rsbuild/', '/rspress/', '/rsdoctor/'],
6 | write: true,
7 | recursive: true,
8 | });
9 |
--------------------------------------------------------------------------------