create-rspack-canary 1.7.0-canary-08772c3f-20251224173339 → 1.7.0-canary-0da65999-20251226173527

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 (37) hide show
  1. package/bin.js +1 -1
  2. package/dist/index.js +29 -29
  3. package/package.json +2 -2
  4. package/template-react-js/index.html +8 -8
  5. package/template-react-js/rspack.config.mjs +64 -64
  6. package/template-react-js/src/App.css +20 -20
  7. package/template-react-js/src/App.jsx +25 -25
  8. package/template-react-js/src/index.css +44 -44
  9. package/template-react-js/src/main.jsx +8 -8
  10. package/template-react-ts/index.html +9 -9
  11. package/template-react-ts/rspack.config.ts +60 -60
  12. package/template-react-ts/src/App.css +20 -20
  13. package/template-react-ts/src/App.tsx +25 -25
  14. package/template-react-ts/src/index.css +44 -44
  15. package/template-react-ts/src/main.tsx +8 -8
  16. package/template-react-ts/src/react-env.d.ts +162 -162
  17. package/template-vanilla-js/index.html +8 -8
  18. package/template-vanilla-js/rspack.config.mjs +43 -43
  19. package/template-vanilla-js/src/index.css +15 -15
  20. package/template-vanilla-js/src/index.js +2 -2
  21. package/template-vanilla-ts/index.html +8 -8
  22. package/template-vanilla-ts/rspack.config.ts +61 -61
  23. package/template-vanilla-ts/src/index.css +15 -15
  24. package/template-vanilla-ts/src/index.ts +2 -2
  25. package/template-vue-js/index.html +8 -8
  26. package/template-vue-js/rspack.config.mjs +63 -63
  27. package/template-vue-js/src/App.vue +18 -18
  28. package/template-vue-js/src/components/HelloWorld.vue +20 -20
  29. package/template-vue-js/src/main.js +4 -4
  30. package/template-vue-js/src/style.css +53 -53
  31. package/template-vue-ts/index.html +8 -8
  32. package/template-vue-ts/rspack.config.ts +65 -65
  33. package/template-vue-ts/src/App.vue +18 -18
  34. package/template-vue-ts/src/components/HelloWorld.vue +20 -20
  35. package/template-vue-ts/src/main.ts +4 -4
  36. package/template-vue-ts/src/shims-vue.d.ts +4 -4
  37. package/template-vue-ts/src/style.css +53 -53
@@ -1,66 +1,66 @@
1
- import { defineConfig } from "@rspack/cli";
2
- import { rspack, type SwcLoaderOptions } from "@rspack/core";
1
+ import { defineConfig } from '@rspack/cli';
2
+ import { rspack, type SwcLoaderOptions } from '@rspack/core';
3
3
 
4
4
  // Target browsers, see: https://github.com/browserslist/browserslist
5
- const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
5
+ const targets = ['last 2 versions', '> 0.2%', 'not dead', 'Firefox ESR'];
6
6
 
7
7
  export default defineConfig({
8
- entry: {
9
- main: "./src/index.ts"
10
- },
11
- resolve: {
12
- extensions: ["...", ".ts"]
13
- },
14
- module: {
15
- rules: [
16
- {
17
- test: /\.svg$/,
18
- type: "asset"
19
- },
20
- {
21
- test: /\.js$/,
22
- use: [
23
- {
24
- loader: "builtin:swc-loader",
25
- options: {
26
- jsc: {
27
- parser: {
28
- syntax: "ecmascript"
29
- }
30
- },
31
- env: { targets }
32
- } satisfies SwcLoaderOptions
33
- }
34
- ]
35
- },
36
- {
37
- test: /\.ts$/,
38
- use: [
39
- {
40
- loader: "builtin:swc-loader",
41
- options: {
42
- jsc: {
43
- parser: {
44
- syntax: "typescript"
45
- }
46
- },
47
- env: { targets }
48
- } satisfies SwcLoaderOptions
49
- }
50
- ]
51
- }
52
- ]
53
- },
54
- plugins: [new rspack.HtmlRspackPlugin({ template: "./index.html" })],
55
- optimization: {
56
- minimizer: [
57
- new rspack.SwcJsMinimizerRspackPlugin(),
58
- new rspack.LightningCssMinimizerRspackPlugin({
59
- minimizerOptions: { targets }
60
- })
61
- ]
62
- },
63
- experiments: {
64
- css: true
65
- }
8
+ entry: {
9
+ main: './src/index.ts',
10
+ },
11
+ resolve: {
12
+ extensions: ['...', '.ts'],
13
+ },
14
+ module: {
15
+ rules: [
16
+ {
17
+ test: /\.svg$/,
18
+ type: 'asset',
19
+ },
20
+ {
21
+ test: /\.js$/,
22
+ use: [
23
+ {
24
+ loader: 'builtin:swc-loader',
25
+ options: {
26
+ jsc: {
27
+ parser: {
28
+ syntax: 'ecmascript',
29
+ },
30
+ },
31
+ env: { targets },
32
+ } satisfies SwcLoaderOptions,
33
+ },
34
+ ],
35
+ },
36
+ {
37
+ test: /\.ts$/,
38
+ use: [
39
+ {
40
+ loader: 'builtin:swc-loader',
41
+ options: {
42
+ jsc: {
43
+ parser: {
44
+ syntax: 'typescript',
45
+ },
46
+ },
47
+ env: { targets },
48
+ } satisfies SwcLoaderOptions,
49
+ },
50
+ ],
51
+ },
52
+ ],
53
+ },
54
+ plugins: [new rspack.HtmlRspackPlugin({ template: './index.html' })],
55
+ optimization: {
56
+ minimizer: [
57
+ new rspack.SwcJsMinimizerRspackPlugin(),
58
+ new rspack.LightningCssMinimizerRspackPlugin({
59
+ minimizerOptions: { targets },
60
+ }),
61
+ ],
62
+ },
63
+ experiments: {
64
+ css: true,
65
+ },
66
66
  });
@@ -1,26 +1,26 @@
1
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);
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
6
  }
7
7
 
8
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;
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
15
  }
16
16
 
17
17
  .content h1 {
18
- font-size: 3.6rem;
19
- font-weight: 700;
18
+ font-size: 3.6rem;
19
+ font-weight: 700;
20
20
  }
21
21
 
22
22
  .content p {
23
- font-size: 1.2rem;
24
- font-weight: 400;
25
- opacity: 0.5;
23
+ font-size: 1.2rem;
24
+ font-weight: 400;
25
+ opacity: 0.5;
26
26
  }
@@ -1,6 +1,6 @@
1
- import "./index.css";
1
+ import './index.css';
2
2
 
3
- document.querySelector("#root")!.innerHTML = `
3
+ document.querySelector('#root')!.innerHTML = `
4
4
  <div class="content">
5
5
  <h1>Vanilla Rspack</h1>
6
6
  <p>Start building amazing things with Rspack.</p>
@@ -1,11 +1,11 @@
1
1
  <!doctype html>
2
2
  <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Vue</title>
7
- </head>
8
- <body>
9
- <div id="app"></div>
10
- </body>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Vue</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ </body>
11
11
  </html>
@@ -1,69 +1,69 @@
1
1
  // @ts-check
2
- import { defineConfig } from "@rspack/cli";
3
- import { rspack } from "@rspack/core";
4
- import { VueLoaderPlugin } from "vue-loader";
2
+ import { defineConfig } from '@rspack/cli';
3
+ import { rspack } from '@rspack/core';
4
+ import { VueLoaderPlugin } from 'vue-loader';
5
5
 
6
6
  // Target browsers, see: https://github.com/browserslist/browserslist
7
- const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
7
+ const targets = ['last 2 versions', '> 0.2%', 'not dead', 'Firefox ESR'];
8
8
 
9
9
  export default defineConfig({
10
- entry: {
11
- main: "./src/main.js"
12
- },
13
- resolve: {
14
- extensions: ["...", ".ts", ".vue"]
15
- },
16
- module: {
17
- rules: [
18
- {
19
- test: /\.vue$/,
20
- loader: "vue-loader",
21
- options: {
22
- experimentalInlineMatchResource: true
23
- }
24
- },
25
- {
26
- test: /\.(js|ts)$/,
27
- use: [
28
- {
29
- loader: "builtin:swc-loader",
30
- /** @type {import('@rspack/core').SwcLoaderOptions} */
31
- options: {
32
- jsc: {
33
- parser: {
34
- syntax: "typescript"
35
- }
36
- },
37
- env: { targets }
38
- }
39
- }
40
- ]
41
- },
42
- {
43
- test: /\.svg/,
44
- type: "asset/resource"
45
- }
46
- ]
47
- },
48
- plugins: [
49
- new rspack.HtmlRspackPlugin({
50
- template: "./index.html"
51
- }),
52
- new rspack.DefinePlugin({
53
- __VUE_OPTIONS_API__: true,
54
- __VUE_PROD_DEVTOOLS__: false
55
- }),
56
- new VueLoaderPlugin()
57
- ],
58
- optimization: {
59
- minimizer: [
60
- new rspack.SwcJsMinimizerRspackPlugin(),
61
- new rspack.LightningCssMinimizerRspackPlugin({
62
- minimizerOptions: { targets }
63
- })
64
- ]
65
- },
66
- experiments: {
67
- css: true
68
- }
10
+ entry: {
11
+ main: './src/main.js',
12
+ },
13
+ resolve: {
14
+ extensions: ['...', '.ts', '.vue'],
15
+ },
16
+ module: {
17
+ rules: [
18
+ {
19
+ test: /\.vue$/,
20
+ loader: 'vue-loader',
21
+ options: {
22
+ experimentalInlineMatchResource: true,
23
+ },
24
+ },
25
+ {
26
+ test: /\.(js|ts)$/,
27
+ use: [
28
+ {
29
+ loader: 'builtin:swc-loader',
30
+ /** @type {import('@rspack/core').SwcLoaderOptions} */
31
+ options: {
32
+ jsc: {
33
+ parser: {
34
+ syntax: 'typescript',
35
+ },
36
+ },
37
+ env: { targets },
38
+ },
39
+ },
40
+ ],
41
+ },
42
+ {
43
+ test: /\.svg/,
44
+ type: 'asset/resource',
45
+ },
46
+ ],
47
+ },
48
+ plugins: [
49
+ new rspack.HtmlRspackPlugin({
50
+ template: './index.html',
51
+ }),
52
+ new rspack.DefinePlugin({
53
+ __VUE_OPTIONS_API__: true,
54
+ __VUE_PROD_DEVTOOLS__: false,
55
+ }),
56
+ new VueLoaderPlugin(),
57
+ ],
58
+ optimization: {
59
+ minimizer: [
60
+ new rspack.SwcJsMinimizerRspackPlugin(),
61
+ new rspack.LightningCssMinimizerRspackPlugin({
62
+ minimizerOptions: { targets },
63
+ }),
64
+ ],
65
+ },
66
+ experiments: {
67
+ css: true,
68
+ },
69
69
  });
@@ -1,35 +1,35 @@
1
1
  <script setup>
2
- import { ref } from "vue";
3
- import HelloWorld from "./components/HelloWorld.vue";
2
+ import { ref } from 'vue';
3
+ import HelloWorld from './components/HelloWorld.vue';
4
4
 
5
- const title = ref("Rspack + Vue");
5
+ const title = ref('Rspack + Vue');
6
6
  </script>
7
7
 
8
8
  <template>
9
- <div>
10
- <a href="https://rspack.rs/" target="_blank">
11
- <img src="./assets/rspack.svg" class="logo" alt="Rspack logo" />
12
- </a>
13
- <a href="https://vuejs.org/" target="_blank">
14
- <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
15
- </a>
16
- </div>
17
- <HelloWorld :msg="title" />
9
+ <div>
10
+ <a href="https://rspack.rs/" target="_blank">
11
+ <img src="./assets/rspack.svg" class="logo" alt="Rspack logo" />
12
+ </a>
13
+ <a href="https://vuejs.org/" target="_blank">
14
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
15
+ </a>
16
+ </div>
17
+ <HelloWorld :msg="title" />
18
18
  </template>
19
19
 
20
20
  <style scoped>
21
21
  .logo {
22
- height: 6em;
23
- padding: 1.5em;
24
- will-change: filter;
25
- transition: filter 300ms;
22
+ height: 6em;
23
+ padding: 1.5em;
24
+ will-change: filter;
25
+ transition: filter 300ms;
26
26
  }
27
27
 
28
28
  .logo:hover {
29
- filter: drop-shadow(0 0 2em #646cffaa);
29
+ filter: drop-shadow(0 0 2em #646cffaa);
30
30
  }
31
31
 
32
32
  .logo.vue:hover {
33
- filter: drop-shadow(0 0 2em #42b883aa);
33
+ filter: drop-shadow(0 0 2em #42b883aa);
34
34
  }
35
35
  </style>
@@ -1,36 +1,36 @@
1
1
  <script setup>
2
- import { ref } from "vue";
2
+ import { ref } from 'vue';
3
3
 
4
4
  defineProps({
5
- msg: {
6
- type: String
7
- }
5
+ msg: {
6
+ type: String,
7
+ },
8
8
  });
9
9
  const count = ref(0);
10
10
  </script>
11
11
 
12
12
  <template>
13
- <h1>{{ msg }}</h1>
13
+ <h1>{{ msg }}</h1>
14
14
 
15
- <div class="card">
16
- <button type="button" @click="count++">count is {{ count }}</button>
17
- <p>
18
- Edit
19
- <code>components/HelloWorld.vue</code> to test HMR
20
- </p>
21
- </div>
15
+ <div class="card">
16
+ <button type="button" @click="count++">count is {{ count }}</button>
17
+ <p>
18
+ Edit
19
+ <code>components/HelloWorld.vue</code> to test HMR
20
+ </p>
21
+ </div>
22
22
 
23
- <p>Check out Rspack which support Vue</p>
24
- <p>
25
- Install
26
- <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
27
- in your IDE for a better DX
28
- </p>
29
- <p class="read-the-docs">Click on the Rspack and Vue logos to learn more</p>
23
+ <p>Check out Rspack which support Vue</p>
24
+ <p>
25
+ Install
26
+ <a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
27
+ in your IDE for a better DX
28
+ </p>
29
+ <p class="read-the-docs">Click on the Rspack and Vue logos to learn more</p>
30
30
  </template>
31
31
 
32
32
  <style scoped>
33
33
  .read-the-docs {
34
- color: #888;
34
+ color: #888;
35
35
  }
36
36
  </style>
@@ -1,5 +1,5 @@
1
- import "./style.css";
2
- import { createApp } from "vue";
3
- import App from "./App.vue";
1
+ import './style.css';
2
+ import { createApp } from 'vue';
3
+ import App from './App.vue';
4
4
 
5
- createApp(App).mount("#app");
5
+ createApp(App).mount('#app');
@@ -1,90 +1,90 @@
1
1
  :root {
2
- font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
- font-size: 16px;
4
- line-height: 24px;
5
- font-weight: 400;
2
+ font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
3
+ font-size: 16px;
4
+ line-height: 24px;
5
+ font-weight: 400;
6
6
 
7
- color-scheme: light dark;
8
- color: rgba(255, 255, 255, 0.87);
9
- background-color: #242424;
7
+ color-scheme: light dark;
8
+ color: rgba(255, 255, 255, 0.87);
9
+ background-color: #242424;
10
10
 
11
- font-synthesis: none;
12
- text-rendering: optimizeLegibility;
13
- -webkit-font-smoothing: antialiased;
14
- -moz-osx-font-smoothing: grayscale;
15
- -webkit-text-size-adjust: 100%;
11
+ font-synthesis: none;
12
+ text-rendering: optimizeLegibility;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ -webkit-text-size-adjust: 100%;
16
16
  }
17
17
 
18
18
  a {
19
- font-weight: 500;
20
- color: #646cff;
21
- text-decoration: inherit;
19
+ font-weight: 500;
20
+ color: #646cff;
21
+ text-decoration: inherit;
22
22
  }
23
23
  a:hover {
24
- color: #535bf2;
24
+ color: #535bf2;
25
25
  }
26
26
 
27
27
  a {
28
- font-weight: 500;
29
- color: #646cff;
30
- text-decoration: inherit;
28
+ font-weight: 500;
29
+ color: #646cff;
30
+ text-decoration: inherit;
31
31
  }
32
32
  a:hover {
33
- color: #535bf2;
33
+ color: #535bf2;
34
34
  }
35
35
 
36
36
  body {
37
- margin: 0;
38
- display: flex;
39
- place-items: center;
40
- min-width: 320px;
41
- min-height: 100vh;
37
+ margin: 0;
38
+ display: flex;
39
+ place-items: center;
40
+ min-width: 320px;
41
+ min-height: 100vh;
42
42
  }
43
43
 
44
44
  h1 {
45
- font-size: 3.2em;
46
- line-height: 1.1;
45
+ font-size: 3.2em;
46
+ line-height: 1.1;
47
47
  }
48
48
 
49
49
  button {
50
- border-radius: 8px;
51
- border: 1px solid transparent;
52
- padding: 0.6em 1.2em;
53
- font-size: 1em;
54
- font-weight: 500;
55
- font-family: inherit;
56
- background-color: #1a1a1a;
57
- cursor: pointer;
58
- transition: border-color 0.25s;
50
+ border-radius: 8px;
51
+ border: 1px solid transparent;
52
+ padding: 0.6em 1.2em;
53
+ font-size: 1em;
54
+ font-weight: 500;
55
+ font-family: inherit;
56
+ background-color: #1a1a1a;
57
+ cursor: pointer;
58
+ transition: border-color 0.25s;
59
59
  }
60
60
  button:hover {
61
- border-color: #646cff;
61
+ border-color: #646cff;
62
62
  }
63
63
  button:focus,
64
64
  button:focus-visible {
65
- outline: 4px auto -webkit-focus-ring-color;
65
+ outline: 4px auto -webkit-focus-ring-color;
66
66
  }
67
67
 
68
68
  .card {
69
- padding: 2em;
69
+ padding: 2em;
70
70
  }
71
71
 
72
72
  #app {
73
- max-width: 1280px;
74
- margin: 0 auto;
75
- padding: 2rem;
76
- text-align: center;
73
+ max-width: 1280px;
74
+ margin: 0 auto;
75
+ padding: 2rem;
76
+ text-align: center;
77
77
  }
78
78
 
79
79
  @media (prefers-color-scheme: light) {
80
- :root {
81
- color: #213547;
82
- background-color: #ffffff;
83
- }
84
- a:hover {
85
- color: #747bff;
86
- }
87
- button {
88
- background-color: #f9f9f9;
89
- }
80
+ :root {
81
+ color: #213547;
82
+ background-color: #ffffff;
83
+ }
84
+ a:hover {
85
+ color: #747bff;
86
+ }
87
+ button {
88
+ background-color: #f9f9f9;
89
+ }
90
90
  }
@@ -1,11 +1,11 @@
1
1
  <!doctype html>
2
2
  <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Vue</title>
7
- </head>
8
- <body>
9
- <div id="app"></div>
10
- </body>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Vue</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ </body>
11
11
  </html>