create-rsbuild 1.2.2 → 1.2.3

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.
package/dist/index.js CHANGED
@@ -22,7 +22,11 @@ async function getTemplateName({ template }) {
22
22
  },
23
23
  {
24
24
  value: 'react',
25
- label: 'React'
25
+ label: 'React 19'
26
+ },
27
+ {
28
+ value: 'react18',
29
+ label: 'React 18'
26
30
  },
27
31
  {
28
32
  value: 'vue3',
@@ -74,6 +78,10 @@ function mapESLintTemplate(templateName) {
74
78
  case 'svelte-js':
75
79
  case 'svelte-ts':
76
80
  return templateName;
81
+ case 'react18-js':
82
+ return 'react-js';
83
+ case 'react18-ts':
84
+ return 'react-js';
77
85
  }
78
86
  const language = templateName.split('-')[1];
79
87
  return `vanilla-${language}`;
@@ -82,8 +90,12 @@ function mapESLintTemplate(templateName) {
82
90
  root: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(src_dirname, '..'),
83
91
  name: 'rsbuild',
84
92
  templates: [
93
+ 'vanilla-js',
94
+ 'vanilla-ts',
85
95
  'react-js',
86
96
  'react-ts',
97
+ 'react18-js',
98
+ 'react18-ts',
87
99
  'vue3-js',
88
100
  'vue3-ts',
89
101
  'vue2-js',
@@ -91,9 +103,7 @@ function mapESLintTemplate(templateName) {
91
103
  'svelte-js',
92
104
  'svelte-ts',
93
105
  'solid-js',
94
- 'solid-ts',
95
- 'vanilla-js',
96
- 'vanilla-ts'
106
+ 'solid-ts'
97
107
  ],
98
108
  getTemplateName,
99
109
  mapESLintTemplate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rsbuild",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Create a new Rsbuild project",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -23,10 +23,10 @@
23
23
  "bin.js"
24
24
  ],
25
25
  "dependencies": {
26
- "create-rstack": "1.2.0"
26
+ "create-rstack": "1.3.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@rslib/core": "0.4.1",
29
+ "@rslib/core": "0.5.0",
30
30
  "@types/node": "^22.13.4",
31
31
  "typescript": "^5.7.3"
32
32
  },
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "rsbuild-react18-js",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rsbuild build",
8
+ "dev": "rsbuild dev --open",
9
+ "preview": "rsbuild preview"
10
+ },
11
+ "dependencies": {
12
+ "react": "^18.3.1",
13
+ "react-dom": "^18.3.1"
14
+ },
15
+ "devDependencies": {
16
+ "@rsbuild/core": "^1.2.8",
17
+ "@rsbuild/plugin-react": "^1.1.0"
18
+ }
19
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginReact } from '@rsbuild/plugin-react';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginReact()],
6
+ });
@@ -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,10 @@
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
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ );
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "rsbuild-react18-ts",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rsbuild build",
8
+ "dev": "rsbuild dev --open",
9
+ "preview": "rsbuild preview"
10
+ },
11
+ "dependencies": {
12
+ "react": "^18.3.1",
13
+ "react-dom": "^18.3.1"
14
+ },
15
+ "devDependencies": {
16
+ "@rsbuild/core": "^1.2.8",
17
+ "@rsbuild/plugin-react": "^1.1.0",
18
+ "@types/react": "^18.3.18",
19
+ "@types/react-dom": "^18.3.5",
20
+ "typescript": "^5.7.3"
21
+ }
22
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginReact } from '@rsbuild/plugin-react';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginReact()],
6
+ });
@@ -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 @@
1
+ /// <reference types="@rsbuild/core/types" />
@@ -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,23 @@
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
+ "module": "ESNext",
12
+ "isolatedModules": true,
13
+ "resolveJsonModule": true,
14
+ "moduleResolution": "Bundler",
15
+ "allowImportingTsExtensions": true,
16
+
17
+ /* type checking */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true
21
+ },
22
+ "include": ["src"]
23
+ }