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,71 +1,71 @@
1
- import { defineConfig } from "@rspack/cli";
1
+ import { defineConfig } from '@rspack/cli';
2
2
  import {
3
- type RspackPluginFunction,
4
- rspack,
5
- type SwcLoaderOptions
6
- } from "@rspack/core";
7
- import { VueLoaderPlugin } from "vue-loader";
3
+ type RspackPluginFunction,
4
+ rspack,
5
+ type SwcLoaderOptions,
6
+ } from '@rspack/core';
7
+ import { VueLoaderPlugin } from 'vue-loader';
8
8
 
9
9
  // Target browsers, see: https://github.com/browserslist/browserslist
10
- const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
10
+ const targets = ['last 2 versions', '> 0.2%', 'not dead', 'Firefox ESR'];
11
11
 
12
12
  export default defineConfig({
13
- entry: {
14
- main: "./src/main.ts"
15
- },
16
- resolve: {
17
- extensions: ["...", ".ts", ".vue"]
18
- },
19
- module: {
20
- rules: [
21
- {
22
- test: /\.vue$/,
23
- loader: "vue-loader",
24
- options: {
25
- experimentalInlineMatchResource: true
26
- }
27
- },
28
- {
29
- test: /\.(js|ts)$/,
30
- use: [
31
- {
32
- loader: "builtin:swc-loader",
33
- options: {
34
- jsc: {
35
- parser: {
36
- syntax: "typescript"
37
- }
38
- },
39
- env: { targets }
40
- } satisfies SwcLoaderOptions
41
- }
42
- ]
43
- },
44
- {
45
- test: /\.svg/,
46
- type: "asset/resource"
47
- }
48
- ]
49
- },
50
- plugins: [
51
- new rspack.HtmlRspackPlugin({
52
- template: "./index.html"
53
- }),
54
- new rspack.DefinePlugin({
55
- __VUE_OPTIONS_API__: true,
56
- __VUE_PROD_DEVTOOLS__: false
57
- }),
58
- new VueLoaderPlugin() as RspackPluginFunction
59
- ],
60
- optimization: {
61
- minimizer: [
62
- new rspack.SwcJsMinimizerRspackPlugin(),
63
- new rspack.LightningCssMinimizerRspackPlugin({
64
- minimizerOptions: { targets }
65
- })
66
- ]
67
- },
68
- experiments: {
69
- css: true
70
- }
13
+ entry: {
14
+ main: './src/main.ts',
15
+ },
16
+ resolve: {
17
+ extensions: ['...', '.ts', '.vue'],
18
+ },
19
+ module: {
20
+ rules: [
21
+ {
22
+ test: /\.vue$/,
23
+ loader: 'vue-loader',
24
+ options: {
25
+ experimentalInlineMatchResource: true,
26
+ },
27
+ },
28
+ {
29
+ test: /\.(js|ts)$/,
30
+ use: [
31
+ {
32
+ loader: 'builtin:swc-loader',
33
+ options: {
34
+ jsc: {
35
+ parser: {
36
+ syntax: 'typescript',
37
+ },
38
+ },
39
+ env: { targets },
40
+ } satisfies SwcLoaderOptions,
41
+ },
42
+ ],
43
+ },
44
+ {
45
+ test: /\.svg/,
46
+ type: 'asset/resource',
47
+ },
48
+ ],
49
+ },
50
+ plugins: [
51
+ new rspack.HtmlRspackPlugin({
52
+ template: './index.html',
53
+ }),
54
+ new rspack.DefinePlugin({
55
+ __VUE_OPTIONS_API__: true,
56
+ __VUE_PROD_DEVTOOLS__: false,
57
+ }),
58
+ new VueLoaderPlugin() as RspackPluginFunction,
59
+ ],
60
+ optimization: {
61
+ minimizer: [
62
+ new rspack.SwcJsMinimizerRspackPlugin(),
63
+ new rspack.LightningCssMinimizerRspackPlugin({
64
+ minimizerOptions: { targets },
65
+ }),
66
+ ],
67
+ },
68
+ experiments: {
69
+ css: true,
70
+ },
71
71
  });
@@ -1,35 +1,35 @@
1
1
  <script setup lang="ts">
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<string>("Rspack + Vue");
5
+ const title = ref<string>('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 lang="ts">
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<number>(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,5 +1,5 @@
1
- declare module "*.vue" {
2
- import type { DefineComponent } from "vue";
3
- const component: DefineComponent<{}, {}, any>;
4
- export default component;
1
+ declare module '*.vue' {
2
+ import type { DefineComponent } from 'vue';
3
+ const component: DefineComponent<{}, {}, any>;
4
+ export default component;
5
5
  }
@@ -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
  }