create-rsbuild 0.0.0-next-20231103091827

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 (62) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +21 -0
  3. package/README.md +19 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +114 -0
  6. package/modern.config.ts +3 -0
  7. package/package.json +41 -0
  8. package/template-common/README.md +29 -0
  9. package/template-common/gitignore +13 -0
  10. package/template-react-js/package.json +18 -0
  11. package/template-react-js/rsbuild.config.mjs +9 -0
  12. package/template-react-js/src/App.jsx +22 -0
  13. package/template-react-js/src/index.css +41 -0
  14. package/template-react-js/src/index.html +10 -0
  15. package/template-react-js/src/index.jsx +11 -0
  16. package/template-react-ts/package.json +21 -0
  17. package/template-react-ts/rsbuild.config.ts +9 -0
  18. package/template-react-ts/src/App.tsx +22 -0
  19. package/template-react-ts/src/index.css +41 -0
  20. package/template-react-ts/src/index.html +10 -0
  21. package/template-react-ts/src/index.tsx +11 -0
  22. package/template-react-ts/tsconfig.json +14 -0
  23. package/template-svelte-js/package.json +17 -0
  24. package/template-svelte-js/rsbuild.config.mjs +6 -0
  25. package/template-svelte-js/src/App.svelte +33 -0
  26. package/template-svelte-js/src/global.css +68 -0
  27. package/template-svelte-js/src/index.js +12 -0
  28. package/template-svelte-ts/package.json +18 -0
  29. package/template-svelte-ts/rsbuild.config.ts +6 -0
  30. package/template-svelte-ts/src/App.svelte +33 -0
  31. package/template-svelte-ts/src/global.css +68 -0
  32. package/template-svelte-ts/src/index.ts +12 -0
  33. package/template-svelte-ts/tsconfig.json +13 -0
  34. package/template-vue2-js/package.json +17 -0
  35. package/template-vue2-js/rsbuild.config.mjs +9 -0
  36. package/template-vue2-js/src/App.vue +27 -0
  37. package/template-vue2-js/src/index.css +41 -0
  38. package/template-vue2-js/src/index.html +10 -0
  39. package/template-vue2-js/src/index.js +8 -0
  40. package/template-vue2-ts/package.json +18 -0
  41. package/template-vue2-ts/rsbuild.config.ts +9 -0
  42. package/template-vue2-ts/src/App.vue +29 -0
  43. package/template-vue2-ts/src/env.d.ts +5 -0
  44. package/template-vue2-ts/src/index.css +41 -0
  45. package/template-vue2-ts/src/index.html +10 -0
  46. package/template-vue2-ts/src/index.ts +8 -0
  47. package/template-vue2-ts/tsconfig.json +13 -0
  48. package/template-vue3-js/package.json +17 -0
  49. package/template-vue3-js/rsbuild.config.mjs +9 -0
  50. package/template-vue3-js/src/App.vue +29 -0
  51. package/template-vue3-js/src/index.css +41 -0
  52. package/template-vue3-js/src/index.html +10 -0
  53. package/template-vue3-js/src/index.js +5 -0
  54. package/template-vue3-ts/package.json +18 -0
  55. package/template-vue3-ts/rsbuild.config.ts +9 -0
  56. package/template-vue3-ts/src/App.vue +23 -0
  57. package/template-vue3-ts/src/env.d.ts +6 -0
  58. package/template-vue3-ts/src/index.css +41 -0
  59. package/template-vue3-ts/src/index.html +10 -0
  60. package/template-vue3-ts/src/index.ts +5 -0
  61. package/template-vue3-ts/tsconfig.json +13 -0
  62. package/tsconfig.json +8 -0
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "rsbuild-svelte-ts",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "svelte": "^4.2.2"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-svelte": "workspace:*",
16
+ "typescript": "^5.2.2"
17
+ }
18
+ }
@@ -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,33 @@
1
+ <script>
2
+ export let name;
3
+ </script>
4
+
5
+ <main>
6
+ <h1>Hello {name}!</h1>
7
+ <p>
8
+ Visit the <a href="https://svelte.dev/tutorial">Svelte tutorial</a> to learn
9
+ how to build Svelte apps.
10
+ </p>
11
+ </main>
12
+
13
+ <style>
14
+ main {
15
+ text-align: center;
16
+ padding: 1em;
17
+ max-width: 240px;
18
+ margin: 0 auto;
19
+ }
20
+
21
+ @media (min-width: 640px) {
22
+ main {
23
+ max-width: none;
24
+ }
25
+ }
26
+
27
+ h1 {
28
+ color: #ff3e00;
29
+ text-transform: uppercase;
30
+ font-size: 4em;
31
+ font-weight: 100;
32
+ }
33
+ </style>
@@ -0,0 +1,68 @@
1
+ html,
2
+ body {
3
+ position: relative;
4
+ width: 100%;
5
+ height: 100%;
6
+ }
7
+
8
+ body {
9
+ color: #333;
10
+ margin: 0;
11
+ padding: 8px;
12
+ box-sizing: border-box;
13
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
14
+ Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
15
+ }
16
+
17
+ a {
18
+ color: rgb(0, 100, 200);
19
+ text-decoration: none;
20
+ }
21
+
22
+ a:hover {
23
+ text-decoration: underline;
24
+ }
25
+
26
+ a:visited {
27
+ color: rgb(0, 80, 160);
28
+ }
29
+
30
+ label {
31
+ display: block;
32
+ }
33
+
34
+ input,
35
+ button,
36
+ select,
37
+ textarea {
38
+ font-family: inherit;
39
+ font-size: inherit;
40
+ -webkit-padding: 0.4em 0;
41
+ padding: 0.4em;
42
+ margin: 0 0 0.5em 0;
43
+ box-sizing: border-box;
44
+ border: 1px solid #ccc;
45
+ border-radius: 2px;
46
+ }
47
+
48
+ input:disabled {
49
+ color: #ccc;
50
+ }
51
+
52
+ button {
53
+ color: #333;
54
+ background-color: #f4f4f4;
55
+ outline: none;
56
+ }
57
+
58
+ button:disabled {
59
+ color: #999;
60
+ }
61
+
62
+ button:not(:disabled):active {
63
+ background-color: #ddd;
64
+ }
65
+
66
+ button:focus {
67
+ border-color: #666;
68
+ }
@@ -0,0 +1,12 @@
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;
@@ -0,0 +1,13 @@
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"]
13
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "rsbuild-vue2-js",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "vue": "^2.7.14"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-vue2": "workspace:*"
16
+ }
17
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginVue2 } from '@rsbuild/plugin-vue2';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginVue2()],
6
+ html: {
7
+ template: './src/index.html',
8
+ },
9
+ });
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div>
3
+ <h1>Rsbuild + Vue</h1>
4
+
5
+ <div class="card">
6
+ <button type="button" @click="count++">count is {{ count }}</button>
7
+ <p>
8
+ Edit
9
+ <code>App.vue</code> to test HMR
10
+ </p>
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ data() {
18
+ return { count: 0 };
19
+ },
20
+ };
21
+ </script>
22
+
23
+ <style scoped>
24
+ .card {
25
+ padding: 2em;
26
+ }
27
+ </style>
@@ -0,0 +1,41 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+ color: #213547;
7
+ background-color: #ffffff;
8
+ max-width: 1280px;
9
+ margin: 0 auto;
10
+ padding: 5rem;
11
+ text-align: center;
12
+ }
13
+
14
+ body {
15
+ margin: 0;
16
+ min-height: 100vh;
17
+ }
18
+
19
+ h1 {
20
+ font-size: 3.2em;
21
+ line-height: 1.1;
22
+ }
23
+
24
+ button {
25
+ border-radius: 8px;
26
+ border: 1px solid transparent;
27
+ padding: 0.6em 1.2em;
28
+ font-size: 1em;
29
+ font-weight: 500;
30
+ font-family: inherit;
31
+ background-color: #f9f9f9;
32
+ cursor: pointer;
33
+ transition: border-color 0.25s;
34
+ }
35
+ button:hover {
36
+ border-color: #646cff;
37
+ }
38
+ button:focus,
39
+ button:focus-visible {
40
+ outline: 4px auto -webkit-focus-ring-color;
41
+ }
@@ -0,0 +1,10 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ </head>
7
+ <body>
8
+ <div id="root"></div>
9
+ </body>
10
+ </html>
@@ -0,0 +1,8 @@
1
+ import Vue from 'vue';
2
+ import './index.css';
3
+ import App from './App.vue';
4
+
5
+ new Vue({
6
+ el: '#root',
7
+ render: (h) => h(App),
8
+ });
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "rsbuild-vue2-ts",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "vue": "^2.7.14"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-vue2": "workspace:*",
16
+ "typescript": "^5.2.2"
17
+ }
18
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginVue2 } from '@rsbuild/plugin-vue2';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginVue2()],
6
+ html: {
7
+ template: './src/index.html',
8
+ },
9
+ });
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div>
3
+ <h1>Rsbuild + Vue</h1>
4
+
5
+ <div class="card">
6
+ <button type="button" @click="count++">count is {{ count }}</button>
7
+ <p>
8
+ Edit
9
+ <code>App.vue</code> to test HMR
10
+ </p>
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import { defineComponent } from 'vue';
17
+
18
+ export default defineComponent({
19
+ data() {
20
+ return { count: 0 };
21
+ },
22
+ });
23
+ </script>
24
+
25
+ <style scoped>
26
+ .card {
27
+ padding: 2em;
28
+ }
29
+ </style>
@@ -0,0 +1,5 @@
1
+ declare module '*.vue' {
2
+ import Vue from 'vue';
3
+
4
+ export default Vue;
5
+ }
@@ -0,0 +1,41 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+ color: #213547;
7
+ background-color: #ffffff;
8
+ max-width: 1280px;
9
+ margin: 0 auto;
10
+ padding: 5rem;
11
+ text-align: center;
12
+ }
13
+
14
+ body {
15
+ margin: 0;
16
+ min-height: 100vh;
17
+ }
18
+
19
+ h1 {
20
+ font-size: 3.2em;
21
+ line-height: 1.1;
22
+ }
23
+
24
+ button {
25
+ border-radius: 8px;
26
+ border: 1px solid transparent;
27
+ padding: 0.6em 1.2em;
28
+ font-size: 1em;
29
+ font-weight: 500;
30
+ font-family: inherit;
31
+ background-color: #f9f9f9;
32
+ cursor: pointer;
33
+ transition: border-color 0.25s;
34
+ }
35
+ button:hover {
36
+ border-color: #646cff;
37
+ }
38
+ button:focus,
39
+ button:focus-visible {
40
+ outline: 4px auto -webkit-focus-ring-color;
41
+ }
@@ -0,0 +1,10 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ </head>
7
+ <body>
8
+ <div id="root"></div>
9
+ </body>
10
+ </html>
@@ -0,0 +1,8 @@
1
+ import Vue from 'vue';
2
+ import './index.css';
3
+ import App from './App.vue';
4
+
5
+ new Vue({
6
+ el: '#root',
7
+ render: (h) => h(App),
8
+ });
@@ -0,0 +1,13 @@
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"]
13
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "rsbuild-vue3-js",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "vue": "^3.3.4"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-vue": "workspace:*"
16
+ }
17
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginVue } from '@rsbuild/plugin-vue';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginVue()],
6
+ html: {
7
+ template: './src/index.html',
8
+ },
9
+ });
@@ -0,0 +1,29 @@
1
+ <script setup>
2
+ import { ref } from 'vue';
3
+
4
+ defineProps({
5
+ msg: {
6
+ type: String,
7
+ },
8
+ });
9
+
10
+ const count = ref(0);
11
+ </script>
12
+
13
+ <template>
14
+ <h1>Rsbuild + Vue</h1>
15
+
16
+ <div class="card">
17
+ <button type="button" @click="count++">count is {{ count }}</button>
18
+ <p>
19
+ Edit
20
+ <code>App.vue</code> to test HMR
21
+ </p>
22
+ </div>
23
+ </template>
24
+
25
+ <style scoped>
26
+ .card {
27
+ padding: 2em;
28
+ }
29
+ </style>
@@ -0,0 +1,41 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+ color: #213547;
7
+ background-color: #ffffff;
8
+ max-width: 1280px;
9
+ margin: 0 auto;
10
+ padding: 5rem;
11
+ text-align: center;
12
+ }
13
+
14
+ body {
15
+ margin: 0;
16
+ min-height: 100vh;
17
+ }
18
+
19
+ h1 {
20
+ font-size: 3.2em;
21
+ line-height: 1.1;
22
+ }
23
+
24
+ button {
25
+ border-radius: 8px;
26
+ border: 1px solid transparent;
27
+ padding: 0.6em 1.2em;
28
+ font-size: 1em;
29
+ font-weight: 500;
30
+ font-family: inherit;
31
+ background-color: #f9f9f9;
32
+ cursor: pointer;
33
+ transition: border-color 0.25s;
34
+ }
35
+ button:hover {
36
+ border-color: #646cff;
37
+ }
38
+ button:focus,
39
+ button:focus-visible {
40
+ outline: 4px auto -webkit-focus-ring-color;
41
+ }
@@ -0,0 +1,10 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ </head>
7
+ <body>
8
+ <div id="root"></div>
9
+ </body>
10
+ </html>
@@ -0,0 +1,5 @@
1
+ import { createApp } from 'vue';
2
+ import './index.css';
3
+ import App from './App.vue';
4
+
5
+ createApp(App).mount('#root');
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "rsbuild-vue3-ts",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "scripts": {
6
+ "dev": "rsbuild dev",
7
+ "build": "rsbuild build",
8
+ "preview": "rsbuild preview"
9
+ },
10
+ "dependencies": {
11
+ "vue": "^3.3.4"
12
+ },
13
+ "devDependencies": {
14
+ "@rsbuild/core": "workspace:*",
15
+ "@rsbuild/plugin-vue": "workspace:*",
16
+ "typescript": "^5.2.2"
17
+ }
18
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from '@rsbuild/core';
2
+ import { pluginVue } from '@rsbuild/plugin-vue';
3
+
4
+ export default defineConfig({
5
+ plugins: [pluginVue()],
6
+ html: {
7
+ template: './src/index.html',
8
+ },
9
+ });
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue';
3
+
4
+ const count = ref(0);
5
+ </script>
6
+
7
+ <template>
8
+ <h1>Rsbuild + Vue</h1>
9
+
10
+ <div class="card">
11
+ <button type="button" @click="count++">count is {{ count }}</button>
12
+ <p>
13
+ Edit
14
+ <code>App.vue</code> to test HMR
15
+ </p>
16
+ </div>
17
+ </template>
18
+
19
+ <style scoped>
20
+ .card {
21
+ padding: 2em;
22
+ }
23
+ </style>
@@ -0,0 +1,6 @@
1
+ declare module '*.vue' {
2
+ import type { DefineComponent } from 'vue';
3
+
4
+ const component: DefineComponent<{}, {}, any>;
5
+ export default component;
6
+ }
@@ -0,0 +1,41 @@
1
+ :root {
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
+ color: #213547;
7
+ background-color: #ffffff;
8
+ max-width: 1280px;
9
+ margin: 0 auto;
10
+ padding: 5rem;
11
+ text-align: center;
12
+ }
13
+
14
+ body {
15
+ margin: 0;
16
+ min-height: 100vh;
17
+ }
18
+
19
+ h1 {
20
+ font-size: 3.2em;
21
+ line-height: 1.1;
22
+ }
23
+
24
+ button {
25
+ border-radius: 8px;
26
+ border: 1px solid transparent;
27
+ padding: 0.6em 1.2em;
28
+ font-size: 1em;
29
+ font-weight: 500;
30
+ font-family: inherit;
31
+ background-color: #f9f9f9;
32
+ cursor: pointer;
33
+ transition: border-color 0.25s;
34
+ }
35
+ button:hover {
36
+ border-color: #646cff;
37
+ }
38
+ button:focus,
39
+ button:focus-visible {
40
+ outline: 4px auto -webkit-focus-ring-color;
41
+ }
@@ -0,0 +1,10 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ </head>
7
+ <body>
8
+ <div id="root"></div>
9
+ </body>
10
+ </html>
@@ -0,0 +1,5 @@
1
+ import { createApp } from 'vue';
2
+ import './index.css';
3
+ import App from './App.vue';
4
+
5
+ createApp(App).mount('#root');
@@ -0,0 +1,13 @@
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"]
13
+ }