create-rsbuild 0.2.18 → 0.3.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # create-rsbuild
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 7b877865: feat(create-rsbuild): add extensions config for Vue projects
8
+
9
+ ## 0.3.0
10
+
3
11
  ## 0.2.18
4
12
 
5
13
  ## 0.2.17
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Rsbuild
6
6
 
7
- Unleash the power of Rspack with the out-of-the-box build tool.
7
+ The Rspack-based build tool. It's fast, out-of-the-box and extensible.
8
8
 
9
9
  ## Documentation
10
10
 
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ async function main() {
59
59
  placeholder: "my-project",
60
60
  validate(value) {
61
61
  if (value.length === 0) {
62
- return `Target folder is required`;
62
+ return "Target folder is required";
63
63
  }
64
64
  if (import_fs.default.existsSync(import_path.default.join(cwd, value))) {
65
65
  return `"${value}" is not empty, please input another folder`;
@@ -75,6 +75,7 @@ async function main() {
75
75
  { value: "vue3", label: "Vue 3" },
76
76
  { value: "vue2", label: "Vue 2" },
77
77
  { value: "lit", label: "Lit" },
78
+ { value: "preact", label: "Preact" },
78
79
  { value: "svelte", label: "Svelte" },
79
80
  { value: "solid", label: "Solid" },
80
81
  { value: "vanilla", label: "Vanilla" }
@@ -90,7 +91,7 @@ async function main() {
90
91
  });
91
92
  checkCancel(language);
92
93
  const srcFolder = import_path.default.join(packageRoot, `template-${framework}-${language}`);
93
- const commonFolder = import_path.default.join(packageRoot, `template-common`);
94
+ const commonFolder = import_path.default.join(packageRoot, "template-common");
94
95
  const distFolder = import_path.default.join(cwd, targetDir);
95
96
  copyFolder(commonFolder, distFolder, version);
96
97
  copyFolder(srcFolder, distFolder, version, import_path.default.basename(targetDir));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rsbuild",
3
- "version": "0.2.18",
3
+ "version": "0.3.1",
4
4
  "description": "Create a new Rsbuild project",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -7,7 +7,8 @@
7
7
  "skipLibCheck": true,
8
8
  "isolatedModules": true,
9
9
  "resolveJsonModule": true,
10
- "moduleResolution": "bundler"
10
+ "moduleResolution": "bundler",
11
+ "useDefineForClassFields": true
11
12
  },
12
13
  "include": ["src"]
13
14
  }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "rsbuild-preact-js",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev --open",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "preact": "^10.19.3"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-preact": "workspace:*"
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginPreact } from '@rsbuild/plugin-preact';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginPreact()],
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 Preact</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 'preact';
2
+ import App from './App';
3
+
4
+ render(<App />, document.getElementById('root'));
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "rsbuild-preact-ts",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev --open",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "preact": "^10.19.3"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-preact": "workspace:*",
16
+ "typescript": "^5.3.0"
17
+ }
18
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginPreact } from '@rsbuild/plugin-preact';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginPreact()],
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 Preact</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 'preact';
2
+ import App from './App';
3
+
4
+ render(<App />, document.getElementById('root')!);
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["DOM", "ES2020"],
5
+ "module": "ESNext",
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "preact",
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "isolatedModules": true,
11
+ "resolveJsonModule": true,
12
+ "moduleResolution": "bundler",
13
+ "useDefineForClassFields": true,
14
+ "paths": {
15
+ "react": ["./node_modules/preact/compat/"],
16
+ "react-dom": ["./node_modules/preact/compat/"]
17
+ }
18
+ },
19
+ "include": ["src"]
20
+ }
@@ -14,8 +14,8 @@
14
14
  "devDependencies": {
15
15
  "@rsbuild/core": "workspace:*",
16
16
  "@rsbuild/plugin-react": "workspace:*",
17
- "@types/react": "^18",
18
- "@types/react-dom": "^18",
17
+ "@types/react": "^18.2.47",
18
+ "@types/react-dom": "^18.2.18",
19
19
  "typescript": "^5.3.0"
20
20
  }
21
21
  }
@@ -8,7 +8,8 @@
8
8
  "skipLibCheck": true,
9
9
  "isolatedModules": true,
10
10
  "resolveJsonModule": true,
11
- "moduleResolution": "bundler"
11
+ "moduleResolution": "bundler",
12
+ "useDefineForClassFields": true
12
13
  },
13
14
  "include": ["src"]
14
15
  }
@@ -3,5 +3,11 @@ import { pluginBabel } from '@rsbuild/plugin-babel';
3
3
  import { pluginSolid } from '@rsbuild/plugin-solid';
4
4
 
5
5
  export default defineConfig({
6
- plugins: [pluginBabel(), pluginSolid()],
6
+ plugins: [
7
+ pluginBabel({
8
+ include: /\.(?:jsx|tsx)$/,
9
+ exclude: /[\\/]node_modules[\\/]/,
10
+ }),
11
+ pluginSolid(),
12
+ ],
7
13
  });
@@ -3,5 +3,11 @@ import { pluginBabel } from '@rsbuild/plugin-babel';
3
3
  import { pluginSolid } from '@rsbuild/plugin-solid';
4
4
 
5
5
  export default defineConfig({
6
- plugins: [pluginBabel(), pluginSolid()],
6
+ plugins: [
7
+ pluginBabel({
8
+ include: /\.(?:jsx|tsx)$/,
9
+ exclude: /[\\/]node_modules[\\/]/,
10
+ }),
11
+ pluginSolid(),
12
+ ],
7
13
  });
@@ -9,7 +9,8 @@
9
9
  "skipLibCheck": true,
10
10
  "isolatedModules": true,
11
11
  "resolveJsonModule": true,
12
- "moduleResolution": "bundler"
12
+ "moduleResolution": "bundler",
13
+ "useDefineForClassFields": true
13
14
  },
14
15
  "include": ["src"]
15
16
  }
@@ -7,7 +7,8 @@
7
7
  "skipLibCheck": true,
8
8
  "isolatedModules": true,
9
9
  "resolveJsonModule": true,
10
- "moduleResolution": "bundler"
10
+ "moduleResolution": "bundler",
11
+ "useDefineForClassFields": true
11
12
  },
12
13
  "include": ["src"]
13
14
  }
@@ -7,7 +7,8 @@
7
7
  "skipLibCheck": true,
8
8
  "isolatedModules": true,
9
9
  "resolveJsonModule": true,
10
- "moduleResolution": "bundler"
10
+ "moduleResolution": "bundler",
11
+ "useDefineForClassFields": true
11
12
  },
12
13
  "include": ["src"]
13
14
  }
@@ -8,7 +8,8 @@
8
8
  "skipLibCheck": true,
9
9
  "isolatedModules": true,
10
10
  "resolveJsonModule": true,
11
- "moduleResolution": "bundler"
11
+ "moduleResolution": "bundler",
12
+ "useDefineForClassFields": true
12
13
  },
13
14
  "include": ["src"]
14
15
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3
+ }
@@ -1,8 +1 @@
1
1
  /// <reference types="@rsbuild/core/types" />
2
-
3
- declare module '*.vue' {
4
- import type { DefineComponent } from 'vue';
5
-
6
- const component: DefineComponent<{}, {}, any>;
7
- export default component;
8
- }
@@ -9,7 +9,8 @@
9
9
  "skipLibCheck": true,
10
10
  "isolatedModules": true,
11
11
  "resolveJsonModule": true,
12
- "moduleResolution": "bundler"
12
+ "moduleResolution": "bundler",
13
+ "useDefineForClassFields": true
13
14
  },
14
15
  "include": ["src"]
15
16
  }