create-rsbuild 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/package.json +5 -5
  2. package/template-common/AGENTS.md +14 -0
  3. package/template-common/README.md +36 -0
  4. package/template-common/gitignore +16 -0
  5. package/template-common/public/favicon.png +0 -0
  6. package/template-lit-js/package.json +17 -0
  7. package/template-lit-js/rsbuild.config.js +14 -0
  8. package/template-lit-js/src/index.css +6 -0
  9. package/template-lit-js/src/index.html +7 -0
  10. package/template-lit-js/src/index.js +4 -0
  11. package/template-lit-js/src/my-element.js +34 -0
  12. package/template-lit-ts/package.json +18 -0
  13. package/template-lit-ts/rsbuild.config.ts +13 -0
  14. package/template-lit-ts/src/env.d.ts +1 -0
  15. package/template-lit-ts/src/index.css +6 -0
  16. package/template-lit-ts/src/index.html +7 -0
  17. package/template-lit-ts/src/index.ts +4 -0
  18. package/template-lit-ts/src/my-element.ts +34 -0
  19. package/template-lit-ts/tsconfig.json +22 -0
  20. package/template-preact-js/package.json +18 -0
  21. package/template-preact-js/rsbuild.config.js +8 -0
  22. package/template-preact-js/src/App.css +26 -0
  23. package/template-preact-js/src/App.jsx +12 -0
  24. package/template-preact-js/src/index.jsx +4 -0
  25. package/template-preact-ts/package.json +19 -0
  26. package/template-preact-ts/rsbuild.config.ts +7 -0
  27. package/template-preact-ts/src/App.css +26 -0
  28. package/template-preact-ts/src/App.tsx +12 -0
  29. package/template-preact-ts/src/env.d.ts +1 -0
  30. package/template-preact-ts/src/index.tsx +7 -0
  31. package/template-preact-ts/tsconfig.json +27 -0
  32. package/template-react-compiler/react-js/package.json +6 -0
  33. package/template-react-compiler/react-js/rsbuild.config.js +18 -0
  34. package/template-react-compiler/react-ts/package.json +6 -0
  35. package/template-react-compiler/react-ts/rsbuild.config.ts +17 -0
  36. package/template-react-js/package.json +19 -0
  37. package/template-react-js/rsbuild.config.js +8 -0
  38. package/template-react-js/src/App.css +26 -0
  39. package/template-react-js/src/App.jsx +12 -0
  40. package/template-react-js/src/index.jsx +10 -0
  41. package/template-react-ts/package.json +22 -0
  42. package/template-react-ts/rsbuild.config.ts +7 -0
  43. package/template-react-ts/src/App.css +26 -0
  44. package/template-react-ts/src/App.tsx +12 -0
  45. package/template-react-ts/src/env.d.ts +11 -0
  46. package/template-react-ts/src/index.tsx +13 -0
  47. package/template-react-ts/tsconfig.json +22 -0
  48. package/template-rstest/AGENTS.md +10 -0
  49. package/template-rstest/react-js/package.json +14 -0
  50. package/template-rstest/react-js/rstest.config.js +8 -0
  51. package/template-rstest/react-js/tests/index.test.jsx +9 -0
  52. package/template-rstest/react-js/tests/rstest.setup.js +4 -0
  53. package/template-rstest/react-ts/package.json +14 -0
  54. package/template-rstest/react-ts/rstest.config.ts +8 -0
  55. package/template-rstest/react-ts/tests/index.test.tsx +9 -0
  56. package/template-rstest/react-ts/tests/rstest.setup.ts +4 -0
  57. package/template-rstest/react-ts/tests/tsconfig.json +7 -0
  58. package/template-rstest/vanilla-js/package.json +13 -0
  59. package/template-rstest/vanilla-js/rstest.config.js +8 -0
  60. package/template-rstest/vanilla-js/tests/dom.test.js +12 -0
  61. package/template-rstest/vanilla-js/tests/rstest.setup.js +4 -0
  62. package/template-rstest/vanilla-ts/package.json +13 -0
  63. package/template-rstest/vanilla-ts/rstest.config.ts +8 -0
  64. package/template-rstest/vanilla-ts/tests/dom.test.ts +12 -0
  65. package/template-rstest/vanilla-ts/tests/rstest.setup.ts +4 -0
  66. package/template-rstest/vanilla-ts/tests/tsconfig.json +7 -0
  67. package/template-rstest/vue-js/package.json +14 -0
  68. package/template-rstest/vue-js/rstest.config.js +8 -0
  69. package/template-rstest/vue-js/tests/index.test.js +9 -0
  70. package/template-rstest/vue-js/tests/rstest.setup.js +4 -0
  71. package/template-rstest/vue-ts/package.json +14 -0
  72. package/template-rstest/vue-ts/rstest.config.ts +8 -0
  73. package/template-rstest/vue-ts/tests/index.test.ts +9 -0
  74. package/template-rstest/vue-ts/tests/rstest.setup.ts +4 -0
  75. package/template-rstest/vue-ts/tests/tsconfig.json +7 -0
  76. package/template-solid-js/package.json +19 -0
  77. package/template-solid-js/rsbuild.config.js +14 -0
  78. package/template-solid-js/src/App.css +26 -0
  79. package/template-solid-js/src/App.jsx +12 -0
  80. package/template-solid-js/src/index.jsx +4 -0
  81. package/template-solid-ts/package.json +20 -0
  82. package/template-solid-ts/rsbuild.config.ts +13 -0
  83. package/template-solid-ts/src/App.css +26 -0
  84. package/template-solid-ts/src/App.tsx +12 -0
  85. package/template-solid-ts/src/env.d.ts +1 -0
  86. package/template-solid-ts/src/index.tsx +7 -0
  87. package/template-solid-ts/tsconfig.json +23 -0
  88. package/template-svelte-js/.browserslistrc +4 -0
  89. package/template-svelte-js/package.json +18 -0
  90. package/template-svelte-js/rsbuild.config.js +8 -0
  91. package/template-svelte-js/src/App.svelte +28 -0
  92. package/template-svelte-js/src/index.css +6 -0
  93. package/template-svelte-js/src/index.js +12 -0
  94. package/template-svelte-ts/.browserslistrc +4 -0
  95. package/template-svelte-ts/package.json +21 -0
  96. package/template-svelte-ts/rsbuild.config.ts +7 -0
  97. package/template-svelte-ts/src/App.svelte +37 -0
  98. package/template-svelte-ts/src/env.d.ts +2 -0
  99. package/template-svelte-ts/src/index.css +6 -0
  100. package/template-svelte-ts/src/index.ts +13 -0
  101. package/template-svelte-ts/tsconfig.json +21 -0
  102. package/template-tailwindcss/package.json +6 -0
  103. package/template-tailwindcss/postcss.config.mjs +5 -0
  104. package/template-vanilla-js/package.json +14 -0
  105. package/template-vanilla-js/rsbuild.config.js +5 -0
  106. package/template-vanilla-js/src/index.css +26 -0
  107. package/template-vanilla-js/src/index.js +8 -0
  108. package/template-vanilla-ts/package.json +15 -0
  109. package/template-vanilla-ts/rsbuild.config.ts +4 -0
  110. package/template-vanilla-ts/src/env.d.ts +1 -0
  111. package/template-vanilla-ts/src/index.css +26 -0
  112. package/template-vanilla-ts/src/index.ts +11 -0
  113. package/template-vanilla-ts/tsconfig.json +21 -0
  114. package/template-vue-js/.vscode/extensions.json +3 -0
  115. package/template-vue-js/package.json +18 -0
  116. package/template-vue-js/rsbuild.config.js +8 -0
  117. package/template-vue-js/src/App.vue +28 -0
  118. package/template-vue-js/src/index.css +6 -0
  119. package/template-vue-js/src/index.js +5 -0
  120. package/template-vue-ts/.vscode/extensions.json +3 -0
  121. package/template-vue-ts/package.json +19 -0
  122. package/template-vue-ts/rsbuild.config.ts +7 -0
  123. package/template-vue-ts/src/App.vue +28 -0
  124. package/template-vue-ts/src/env.d.ts +8 -0
  125. package/template-vue-ts/src/index.css +6 -0
  126. package/template-vue-ts/src/index.ts +5 -0
  127. package/template-vue-ts/tsconfig.json +23 -0
@@ -0,0 +1,26 @@
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
+
8
+ .content {
9
+ display: flex;
10
+ min-height: 100vh;
11
+ line-height: 1.1;
12
+ text-align: center;
13
+ flex-direction: column;
14
+ justify-content: center;
15
+ }
16
+
17
+ .content h1 {
18
+ font-size: 3.6rem;
19
+ font-weight: 700;
20
+ }
21
+
22
+ .content p {
23
+ font-size: 1.2rem;
24
+ font-weight: 400;
25
+ opacity: 0.5;
26
+ }
@@ -0,0 +1,12 @@
1
+ import './App.css';
2
+
3
+ const App = () => {
4
+ return (
5
+ <div className="content">
6
+ <h1>Rsbuild with React</h1>
7
+ <p>Start building amazing things with Rsbuild.</p>
8
+ </div>
9
+ );
10
+ };
11
+
12
+ export default App;
@@ -0,0 +1,11 @@
1
+ /// <reference types="@rsbuild/core/types" />
2
+
3
+ /**
4
+ * Imports the SVG file as a React component.
5
+ * @requires [@rsbuild/plugin-svgr](https://npmjs.com/package/@rsbuild/plugin-svgr)
6
+ */
7
+ declare module '*.svg?react' {
8
+ import type React from 'react';
9
+ const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
10
+ export default ReactComponent;
11
+ }
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ const rootEl = document.getElementById('root');
6
+ if (rootEl) {
7
+ const root = ReactDOM.createRoot(rootEl);
8
+ root.render(
9
+ <React.StrictMode>
10
+ <App />
11
+ </React.StrictMode>,
12
+ );
13
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["DOM", "ES2020"],
4
+ "jsx": "react-jsx",
5
+ "target": "ES2020",
6
+ "noEmit": true,
7
+ "skipLibCheck": true,
8
+ "useDefineForClassFields": true,
9
+
10
+ /* modules */
11
+ "moduleDetection": "force",
12
+ "moduleResolution": "bundler",
13
+ "verbatimModuleSyntax": true,
14
+ "resolveJsonModule": true,
15
+ "allowImportingTsExtensions": true,
16
+
17
+ /* type checking */
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true
20
+ },
21
+ "include": ["src"]
22
+ }
@@ -0,0 +1,10 @@
1
+ ## Docs
2
+
3
+ - Rstest: https://rstest.rs/llms.txt
4
+
5
+ ## Tools
6
+
7
+ ### Rstest
8
+
9
+ - Run `{{ packageManager }} run test` to run tests
10
+ - Run `{{ packageManager }} run test:watch` to run tests in watch mode
@@ -0,0 +1,14 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest",
4
+ "test:watch": "rstest --watch"
5
+ },
6
+ "devDependencies": {
7
+ "@testing-library/dom": "^10.4.1",
8
+ "@testing-library/jest-dom": "^6.9.1",
9
+ "@testing-library/react": "^16.3.2",
10
+ "@rstest/core": "^0.9.10",
11
+ "@rstest/adapter-rsbuild": "^0.2.6",
12
+ "happy-dom": "^20.9.0"
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2
+ import { defineConfig } from '@rstest/core';
3
+
4
+ // Docs: https://rstest.rs/config/
5
+ export default defineConfig({
6
+ extends: withRsbuildConfig(),
7
+ setupFiles: ['./tests/rstest.setup.js'],
8
+ });
@@ -0,0 +1,9 @@
1
+ import { expect, test } from '@rstest/core';
2
+ import { render, screen } from '@testing-library/react';
3
+ import App from '../src/App';
4
+
5
+ test('renders the main page', () => {
6
+ const testMessage = 'Rsbuild with React';
7
+ render(<App />);
8
+ expect(screen.getByText(testMessage)).toBeInTheDocument();
9
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from '@rstest/core';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,14 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest",
4
+ "test:watch": "rstest --watch"
5
+ },
6
+ "devDependencies": {
7
+ "@testing-library/dom": "^10.4.1",
8
+ "@testing-library/jest-dom": "^6.9.1",
9
+ "@testing-library/react": "^16.3.2",
10
+ "@rstest/core": "^0.9.10",
11
+ "@rstest/adapter-rsbuild": "^0.2.6",
12
+ "happy-dom": "^20.9.0"
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2
+ import { defineConfig } from '@rstest/core';
3
+
4
+ // Docs: https://rstest.rs/config/
5
+ export default defineConfig({
6
+ extends: withRsbuildConfig(),
7
+ setupFiles: ['./tests/rstest.setup.ts'],
8
+ });
@@ -0,0 +1,9 @@
1
+ import { expect, test } from '@rstest/core';
2
+ import { render, screen } from '@testing-library/react';
3
+ import App from '../src/App';
4
+
5
+ test('renders the main page', () => {
6
+ const testMessage = 'Rsbuild with React';
7
+ render(<App />);
8
+ expect(screen.getByText(testMessage)).toBeInTheDocument();
9
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from '@rstest/core';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": ["@testing-library/jest-dom"]
5
+ },
6
+ "include": ["./"]
7
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest",
4
+ "test:watch": "rstest --watch"
5
+ },
6
+ "devDependencies": {
7
+ "@testing-library/dom": "^10.4.1",
8
+ "@testing-library/jest-dom": "^6.9.1",
9
+ "@rstest/core": "^0.9.10",
10
+ "@rstest/adapter-rsbuild": "^0.2.6",
11
+ "happy-dom": "^20.9.0"
12
+ }
13
+ }
@@ -0,0 +1,8 @@
1
+ import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2
+ import { defineConfig } from '@rstest/core';
3
+
4
+ // Docs: https://rstest.rs/config/
5
+ export default defineConfig({
6
+ extends: withRsbuildConfig(),
7
+ setupFiles: ['./tests/rstest.setup.js'],
8
+ });
@@ -0,0 +1,12 @@
1
+ import { expect, test } from '@rstest/core';
2
+ import { screen } from '@testing-library/dom';
3
+
4
+ test('test dom', () => {
5
+ document.body.innerHTML = `
6
+ <span data-testid="not-empty"><span data-testid="empty"></span></span>
7
+ <div data-testid="visible">Visible Example</div>
8
+ `;
9
+
10
+ expect(screen.queryByTestId('not-empty')).toBeInTheDocument();
11
+ expect(screen.getByText('Visible Example')).toBeVisible();
12
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from '@rstest/core';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,13 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest",
4
+ "test:watch": "rstest --watch"
5
+ },
6
+ "devDependencies": {
7
+ "@testing-library/dom": "^10.4.1",
8
+ "@testing-library/jest-dom": "^6.9.1",
9
+ "@rstest/core": "^0.9.10",
10
+ "@rstest/adapter-rsbuild": "^0.2.6",
11
+ "happy-dom": "^20.9.0"
12
+ }
13
+ }
@@ -0,0 +1,8 @@
1
+ import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2
+ import { defineConfig } from '@rstest/core';
3
+
4
+ // Docs: https://rstest.rs/config/
5
+ export default defineConfig({
6
+ extends: withRsbuildConfig(),
7
+ setupFiles: ['./tests/rstest.setup.ts'],
8
+ });
@@ -0,0 +1,12 @@
1
+ import { expect, test } from '@rstest/core';
2
+ import { screen } from '@testing-library/dom';
3
+
4
+ test('test dom', () => {
5
+ document.body.innerHTML = `
6
+ <span data-testid="not-empty"><span data-testid="empty"></span></span>
7
+ <div data-testid="visible">Visible Example</div>
8
+ `;
9
+
10
+ expect(screen.queryByTestId('not-empty')).toBeInTheDocument();
11
+ expect(screen.getByText('Visible Example')).toBeVisible();
12
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from '@rstest/core';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": ["@testing-library/jest-dom"]
5
+ },
6
+ "include": ["./"]
7
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest",
4
+ "test:watch": "rstest --watch"
5
+ },
6
+ "devDependencies": {
7
+ "@testing-library/dom": "^10.4.1",
8
+ "@testing-library/jest-dom": "^6.9.1",
9
+ "@testing-library/vue": "^8.1.0",
10
+ "@rstest/core": "^0.9.10",
11
+ "@rstest/adapter-rsbuild": "^0.2.6",
12
+ "happy-dom": "^20.9.0"
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2
+ import { defineConfig } from '@rstest/core';
3
+
4
+ // Docs: https://rstest.rs/config/
5
+ export default defineConfig({
6
+ extends: withRsbuildConfig(),
7
+ setupFiles: ['./tests/rstest.setup.js'],
8
+ });
@@ -0,0 +1,9 @@
1
+ import { expect, test } from '@rstest/core';
2
+ import { render, screen } from '@testing-library/vue';
3
+ import App from '../src/App.vue';
4
+
5
+ test('renders the main page', () => {
6
+ const testMessage = 'Rsbuild with Vue';
7
+ render(App);
8
+ expect(screen.getByText(testMessage)).toBeInTheDocument();
9
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from '@rstest/core';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,14 @@
1
+ {
2
+ "scripts": {
3
+ "test": "rstest",
4
+ "test:watch": "rstest --watch"
5
+ },
6
+ "devDependencies": {
7
+ "@testing-library/dom": "^10.4.1",
8
+ "@testing-library/jest-dom": "^6.9.1",
9
+ "@testing-library/vue": "^8.1.0",
10
+ "@rstest/core": "^0.9.10",
11
+ "@rstest/adapter-rsbuild": "^0.2.6",
12
+ "happy-dom": "^20.9.0"
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { withRsbuildConfig } from '@rstest/adapter-rsbuild';
2
+ import { defineConfig } from '@rstest/core';
3
+
4
+ // Docs: https://rstest.rs/config/
5
+ export default defineConfig({
6
+ extends: withRsbuildConfig(),
7
+ setupFiles: ['./tests/rstest.setup.ts'],
8
+ });
@@ -0,0 +1,9 @@
1
+ import { expect, test } from '@rstest/core';
2
+ import { render, screen } from '@testing-library/vue';
3
+ import App from '../src/App.vue';
4
+
5
+ test('renders the main page', () => {
6
+ const testMessage = 'Rsbuild with Vue';
7
+ render(App);
8
+ expect(screen.getByText(testMessage)).toBeInTheDocument();
9
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from '@rstest/core';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": ["@testing-library/jest-dom"]
5
+ },
6
+ "include": ["./"]
7
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "rsbuild-solid-js",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rsbuild build",
8
+ "dev": "rsbuild --open",
9
+ "preview": "rsbuild preview"
10
+ },
11
+ "dependencies": {
12
+ "solid-js": "^1.9.12"
13
+ },
14
+ "devDependencies": {
15
+ "@rsbuild/core": "^2.0.3",
16
+ "@rsbuild/plugin-babel": "^1.1.2",
17
+ "@rsbuild/plugin-solid": "^1.2.0"
18
+ }
19
+ }
@@ -0,0 +1,14 @@
1
+ // @ts-check
2
+ import { defineConfig } from '@rsbuild/core';
3
+ import { pluginBabel } from '@rsbuild/plugin-babel';
4
+ import { pluginSolid } from '@rsbuild/plugin-solid';
5
+
6
+ // Docs: https://rsbuild.rs/config/
7
+ export default defineConfig({
8
+ plugins: [
9
+ pluginBabel({
10
+ include: /\.(?:jsx|tsx)$/,
11
+ }),
12
+ pluginSolid(),
13
+ ],
14
+ });
@@ -0,0 +1,26 @@
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
+
8
+ .content {
9
+ display: flex;
10
+ min-height: 100vh;
11
+ line-height: 1.1;
12
+ text-align: center;
13
+ flex-direction: column;
14
+ justify-content: center;
15
+ }
16
+
17
+ .content h1 {
18
+ font-size: 3.6rem;
19
+ font-weight: 700;
20
+ }
21
+
22
+ .content p {
23
+ font-size: 1.2rem;
24
+ font-weight: 400;
25
+ opacity: 0.5;
26
+ }
@@ -0,0 +1,12 @@
1
+ import './App.css';
2
+
3
+ const App = () => {
4
+ return (
5
+ <div class="content">
6
+ <h1>Rsbuild with Solid</h1>
7
+ <p>Start building amazing things with Rsbuild.</p>
8
+ </div>
9
+ );
10
+ };
11
+
12
+ export default App;
@@ -0,0 +1,4 @@
1
+ import { render } from 'solid-js/web';
2
+ import App from './App';
3
+
4
+ render(() => <App />, document.getElementById('root'));
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "rsbuild-solid-ts",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rsbuild build",
8
+ "dev": "rsbuild --open",
9
+ "preview": "rsbuild preview"
10
+ },
11
+ "dependencies": {
12
+ "solid-js": "^1.9.12"
13
+ },
14
+ "devDependencies": {
15
+ "@rsbuild/core": "^2.0.3",
16
+ "@rsbuild/plugin-babel": "^1.1.2",
17
+ "@rsbuild/plugin-solid": "^1.2.0",
18
+ "typescript": "^6.0.3"
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginBabel } from '@rsbuild/plugin-babel';
3
+ import { pluginSolid } from '@rsbuild/plugin-solid';
4
+
5
+ // Docs: https://rsbuild.rs/config/
6
+ export default defineConfig({
7
+ plugins: [
8
+ pluginBabel({
9
+ include: /\.(?:jsx|tsx)$/,
10
+ }),
11
+ pluginSolid(),
12
+ ],
13
+ });
@@ -0,0 +1,26 @@
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
+
8
+ .content {
9
+ display: flex;
10
+ min-height: 100vh;
11
+ line-height: 1.1;
12
+ text-align: center;
13
+ flex-direction: column;
14
+ justify-content: center;
15
+ }
16
+
17
+ .content h1 {
18
+ font-size: 3.6rem;
19
+ font-weight: 700;
20
+ }
21
+
22
+ .content p {
23
+ font-size: 1.2rem;
24
+ font-weight: 400;
25
+ opacity: 0.5;
26
+ }
@@ -0,0 +1,12 @@
1
+ import './App.css';
2
+
3
+ const App = () => {
4
+ return (
5
+ <div class="content">
6
+ <h1>Rsbuild with Solid</h1>
7
+ <p>Start building amazing things with Rsbuild.</p>
8
+ </div>
9
+ );
10
+ };
11
+
12
+ export default App;
@@ -0,0 +1 @@
1
+ /// <reference types="@rsbuild/core/types" />
@@ -0,0 +1,7 @@
1
+ import { render } from 'solid-js/web';
2
+ import App from './App';
3
+
4
+ const root = document.getElementById('root');
5
+ if (root) {
6
+ render(() => <App />, root);
7
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["DOM", "ES2020"],
4
+ "jsx": "preserve",
5
+ "target": "ES2020",
6
+ "noEmit": true,
7
+ "skipLibCheck": true,
8
+ "jsxImportSource": "solid-js",
9
+ "useDefineForClassFields": true,
10
+
11
+ /* modules */
12
+ "moduleDetection": "force",
13
+ "moduleResolution": "bundler",
14
+ "verbatimModuleSyntax": true,
15
+ "resolveJsonModule": true,
16
+ "allowImportingTsExtensions": true,
17
+
18
+ /* type checking */
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true
21
+ },
22
+ "include": ["src"]
23
+ }
@@ -0,0 +1,4 @@
1
+ Chrome >= 107
2
+ Edge >= 107
3
+ Firefox >= 104
4
+ Safari >= 16
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "rsbuild-svelte-js",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rsbuild build",
8
+ "dev": "rsbuild --open",
9
+ "preview": "rsbuild preview"
10
+ },
11
+ "dependencies": {
12
+ "svelte": "^5.55.5"
13
+ },
14
+ "devDependencies": {
15
+ "@rsbuild/core": "^2.0.3",
16
+ "@rsbuild/plugin-svelte": "^1.1.1"
17
+ }
18
+ }
@@ -0,0 +1,8 @@
1
+ // @ts-check
2
+ import { defineConfig } from '@rsbuild/core';
3
+ import { pluginSvelte } from '@rsbuild/plugin-svelte';
4
+
5
+ // Docs: https://rsbuild.rs/config/
6
+ export default defineConfig({
7
+ plugins: [pluginSvelte()],
8
+ });
@@ -0,0 +1,28 @@
1
+ <main>
2
+ <div class="content">
3
+ <h1>Rsbuild with Svelte</h1>
4
+ <p>Start building amazing things with Rsbuild.</p>
5
+ </div>
6
+ </main>
7
+
8
+ <style>
9
+ .content {
10
+ display: flex;
11
+ min-height: 100vh;
12
+ line-height: 1.1;
13
+ text-align: center;
14
+ flex-direction: column;
15
+ justify-content: center;
16
+ }
17
+
18
+ .content h1 {
19
+ font-size: 3.6rem;
20
+ font-weight: 700;
21
+ }
22
+
23
+ .content p {
24
+ font-size: 1.2rem;
25
+ font-weight: 400;
26
+ opacity: 0.5;
27
+ }
28
+ </style>