create-rsbuild 1.0.3 → 1.0.4

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
@@ -43,7 +43,11 @@ async function getTemplateName(param) {
43
43
  },
44
44
  {
45
45
  value: 'svelte',
46
- label: 'Svelte'
46
+ label: 'Svelte 5'
47
+ },
48
+ {
49
+ value: 'svelte4',
50
+ label: 'Svelte 4'
47
51
  },
48
52
  {
49
53
  value: 'solid',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rsbuild",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Create a new Rsbuild project",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -8,7 +8,7 @@
8
8
  "preview": "rsbuild preview"
9
9
  },
10
10
  "dependencies": {
11
- "svelte": "^4.2.19"
11
+ "svelte": "^5.0.3"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@rsbuild/core": "^1.0.13",
@@ -1,8 +1,12 @@
1
+ import { mount } from 'svelte';
1
2
  import App from './App.svelte';
2
3
  import './index.css';
3
4
 
4
- const app = new App({
5
+ const app = mount(App, {
5
6
  target: document.body,
7
+ props: {
8
+ name: 'world',
9
+ },
6
10
  });
7
11
 
8
12
  export default app;
@@ -9,7 +9,7 @@
9
9
  "svelte-check": "svelte-check --tsconfig ./tsconfig.json"
10
10
  },
11
11
  "dependencies": {
12
- "svelte": "^4.2.19"
12
+ "svelte": "^5.0.3"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rsbuild/core": "^1.0.13",
@@ -1,8 +1,12 @@
1
+ import { mount } from 'svelte';
1
2
  import App from './App.svelte';
2
3
  import './index.css';
3
4
 
4
- const app = new App({
5
+ const app = mount(App, {
5
6
  target: document.body,
7
+ props: {
8
+ name: 'world',
9
+ },
6
10
  });
7
11
 
8
12
  export default app;
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "rsbuild-svelte4-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
+ "svelte": "^4.2.19"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "^1.0.13",
15
+ "@rsbuild/plugin-svelte": "^1.0.1"
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginSvelte } from '@rsbuild/plugin-svelte';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginSvelte()],
6
+ });
@@ -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>
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1,8 @@
1
+ import App from './App.svelte';
2
+ import './index.css';
3
+
4
+ const app = new App({
5
+ target: document.body,
6
+ });
7
+
8
+ export default app;
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "rsbuild-svelte4-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
+ "svelte-check": "svelte-check --tsconfig ./tsconfig.json"
10
+ },
11
+ "dependencies": {
12
+ "svelte": "^4.2.19"
13
+ },
14
+ "devDependencies": {
15
+ "@rsbuild/core": "^1.0.13",
16
+ "@rsbuild/plugin-svelte": "^1.0.1",
17
+ "svelte-check": "^4.0.5",
18
+ "typescript": "^5.6.3"
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginSvelte } from '@rsbuild/plugin-svelte';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginSvelte()],
6
+ });
@@ -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>
@@ -0,0 +1,2 @@
1
+ /// <reference types="@rsbuild/core/types" />
2
+ /// <reference types="svelte" />
@@ -0,0 +1,6 @@
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
+ }
@@ -0,0 +1,8 @@
1
+ import App from './App.svelte';
2
+ import './index.css';
3
+
4
+ const app = new App({
5
+ target: document.body,
6
+ });
7
+
8
+ export default app;
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["DOM", "ES2020"],
5
+ "module": "ESNext",
6
+ "noEmit": true,
7
+ "strict": true,
8
+ "skipLibCheck": true,
9
+ // svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
10
+ // to enforce using `import type` instead of `import` for Types.
11
+ "verbatimModuleSyntax": true,
12
+ "isolatedModules": true,
13
+ "resolveJsonModule": true,
14
+ "moduleResolution": "bundler",
15
+ "useDefineForClassFields": true,
16
+ "allowImportingTsExtensions": true
17
+ },
18
+ "include": ["src"]
19
+ }