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";
3
- import { ReactRefreshRspackPlugin } from "@rspack/plugin-react-refresh";
1
+ import { defineConfig } from '@rspack/cli';
2
+ import { rspack, type SwcLoaderOptions } from '@rspack/core';
3
+ import { ReactRefreshRspackPlugin } from '@rspack/plugin-react-refresh';
4
4
 
5
- const isDev = process.env.NODE_ENV === "development";
5
+ const isDev = process.env.NODE_ENV === 'development';
6
6
 
7
7
  // Target browsers, see: https://github.com/browserslist/browserslist
8
- const targets = ["last 2 versions", "> 0.2%", "not dead", "Firefox ESR"];
8
+ const targets = ['last 2 versions', '> 0.2%', 'not dead', 'Firefox ESR'];
9
9
 
10
10
  export default defineConfig({
11
- entry: {
12
- main: "./src/main.tsx"
13
- },
14
- resolve: {
15
- extensions: ["...", ".ts", ".tsx", ".jsx"]
16
- },
17
- module: {
18
- rules: [
19
- {
20
- test: /\.svg$/,
21
- type: "asset"
22
- },
23
- {
24
- test: /\.(jsx?|tsx?)$/,
25
- use: [
26
- {
27
- loader: "builtin:swc-loader",
28
- options: {
29
- jsc: {
30
- parser: {
31
- syntax: "typescript",
32
- tsx: true
33
- },
34
- transform: {
35
- react: {
36
- runtime: "automatic",
37
- development: isDev,
38
- refresh: isDev
39
- }
40
- }
41
- },
42
- env: { targets }
43
- } satisfies SwcLoaderOptions
44
- }
45
- ]
46
- }
47
- ]
48
- },
49
- plugins: [
50
- new rspack.HtmlRspackPlugin({
51
- template: "./index.html"
52
- }),
53
- isDev ? new ReactRefreshRspackPlugin() : null
54
- ],
55
- optimization: {
56
- minimizer: [
57
- new rspack.SwcJsMinimizerRspackPlugin(),
58
- new rspack.LightningCssMinimizerRspackPlugin({
59
- minimizerOptions: { targets }
60
- })
61
- ]
62
- },
63
- experiments: {
64
- css: true
65
- }
11
+ entry: {
12
+ main: './src/main.tsx',
13
+ },
14
+ resolve: {
15
+ extensions: ['...', '.ts', '.tsx', '.jsx'],
16
+ },
17
+ module: {
18
+ rules: [
19
+ {
20
+ test: /\.svg$/,
21
+ type: 'asset',
22
+ },
23
+ {
24
+ test: /\.(jsx?|tsx?)$/,
25
+ use: [
26
+ {
27
+ loader: 'builtin:swc-loader',
28
+ options: {
29
+ jsc: {
30
+ parser: {
31
+ syntax: 'typescript',
32
+ tsx: true,
33
+ },
34
+ transform: {
35
+ react: {
36
+ runtime: 'automatic',
37
+ development: isDev,
38
+ refresh: isDev,
39
+ },
40
+ },
41
+ },
42
+ env: { targets },
43
+ } satisfies SwcLoaderOptions,
44
+ },
45
+ ],
46
+ },
47
+ ],
48
+ },
49
+ plugins: [
50
+ new rspack.HtmlRspackPlugin({
51
+ template: './index.html',
52
+ }),
53
+ isDev ? new ReactRefreshRspackPlugin() : null,
54
+ ],
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,41 +1,41 @@
1
1
  #root {
2
- max-width: 1280px;
3
- margin: 0 auto;
4
- padding: 2rem;
5
- text-align: center;
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
6
  }
7
7
 
8
8
  .logo {
9
- height: 6em;
10
- padding: 1.5em;
11
- will-change: filter;
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
12
  }
13
13
  .logo:hover {
14
- filter: drop-shadow(0 0 2em #646cffaa);
14
+ filter: drop-shadow(0 0 2em #646cffaa);
15
15
  }
16
16
  .logo.react:hover {
17
- filter: drop-shadow(0 0 2em #61dafbaa);
17
+ filter: drop-shadow(0 0 2em #61dafbaa);
18
18
  }
19
19
 
20
20
  @keyframes logo-spin {
21
- from {
22
- transform: rotate(0deg);
23
- }
24
- to {
25
- transform: rotate(360deg);
26
- }
21
+ from {
22
+ transform: rotate(0deg);
23
+ }
24
+ to {
25
+ transform: rotate(360deg);
26
+ }
27
27
  }
28
28
 
29
29
  @media (prefers-reduced-motion: no-preference) {
30
- a > .logo {
31
- animation: logo-spin infinite 20s linear;
32
- }
30
+ a > .logo {
31
+ animation: logo-spin infinite 20s linear;
32
+ }
33
33
  }
34
34
 
35
35
  .card {
36
- padding: 2em;
36
+ padding: 2em;
37
37
  }
38
38
 
39
39
  .read-the-docs {
40
- color: #888;
40
+ color: #888;
41
41
  }
@@ -1,31 +1,31 @@
1
- import { useState } from "react";
2
- import reactLogo from "./assets/react.svg";
3
- import "./App.css";
1
+ import { useState } from 'react';
2
+ import reactLogo from './assets/react.svg';
3
+ import './App.css';
4
4
 
5
5
  function App() {
6
- const [count, setCount] = useState(0);
6
+ const [count, setCount] = useState(0);
7
7
 
8
- return (
9
- <div className="App">
10
- <div>
11
- <a href="https://reactjs.org" target="_blank" rel="noreferrer">
12
- <img src={reactLogo} className="logo react" alt="React logo" />
13
- </a>
14
- </div>
15
- <h1>Rspack + React + TypeScript</h1>
16
- <div className="card">
17
- <button type="button" onClick={() => setCount(count => count + 1)}>
18
- count is {count}
19
- </button>
20
- <p>
21
- Edit <code>src/App.tsx</code> and save to test HMR
22
- </p>
23
- </div>
24
- <p className="read-the-docs">
25
- Click on the Rspack and React logos to learn more
26
- </p>
27
- </div>
28
- );
8
+ return (
9
+ <div className="App">
10
+ <div>
11
+ <a href="https://reactjs.org" target="_blank" rel="noreferrer">
12
+ <img src={reactLogo} className="logo react" alt="React logo" />
13
+ </a>
14
+ </div>
15
+ <h1>Rspack + React + TypeScript</h1>
16
+ <div className="card">
17
+ <button type="button" onClick={() => setCount((count) => count + 1)}>
18
+ count is {count}
19
+ </button>
20
+ <p>
21
+ Edit <code>src/App.tsx</code> and save to test HMR
22
+ </p>
23
+ </div>
24
+ <p className="read-the-docs">
25
+ Click on the Rspack and React logos to learn more
26
+ </p>
27
+ </div>
28
+ );
29
29
  }
30
30
 
31
31
  export default App;
@@ -1,70 +1,70 @@
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
  body {
28
- margin: 0;
29
- display: flex;
30
- place-items: center;
31
- min-width: 320px;
32
- min-height: 100vh;
28
+ margin: 0;
29
+ display: flex;
30
+ place-items: center;
31
+ min-width: 320px;
32
+ min-height: 100vh;
33
33
  }
34
34
 
35
35
  h1 {
36
- font-size: 3.2em;
37
- line-height: 1.1;
36
+ font-size: 3.2em;
37
+ line-height: 1.1;
38
38
  }
39
39
 
40
40
  button {
41
- border-radius: 8px;
42
- border: 1px solid transparent;
43
- padding: 0.6em 1.2em;
44
- font-size: 1em;
45
- font-weight: 500;
46
- font-family: inherit;
47
- background-color: #1a1a1a;
48
- cursor: pointer;
49
- transition: border-color 0.25s;
41
+ border-radius: 8px;
42
+ border: 1px solid transparent;
43
+ padding: 0.6em 1.2em;
44
+ font-size: 1em;
45
+ font-weight: 500;
46
+ font-family: inherit;
47
+ background-color: #1a1a1a;
48
+ cursor: pointer;
49
+ transition: border-color 0.25s;
50
50
  }
51
51
  button:hover {
52
- border-color: #646cff;
52
+ border-color: #646cff;
53
53
  }
54
54
  button:focus,
55
55
  button:focus-visible {
56
- outline: 4px auto -webkit-focus-ring-color;
56
+ outline: 4px auto -webkit-focus-ring-color;
57
57
  }
58
58
 
59
59
  @media (prefers-color-scheme: light) {
60
- :root {
61
- color: #213547;
62
- background-color: #ffffff;
63
- }
64
- a:hover {
65
- color: #747bff;
66
- }
67
- button {
68
- background-color: #f9f9f9;
69
- }
60
+ :root {
61
+ color: #213547;
62
+ background-color: #ffffff;
63
+ }
64
+ a:hover {
65
+ color: #747bff;
66
+ }
67
+ button {
68
+ background-color: #f9f9f9;
69
+ }
70
70
  }
@@ -1,10 +1,10 @@
1
- import React from "react";
2
- import ReactDOM from "react-dom/client";
3
- import App from "./App.tsx";
4
- import "./index.css";
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App.tsx';
4
+ import './index.css';
5
5
 
6
- ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
7
- <React.StrictMode>
8
- <App />
9
- </React.StrictMode>
6
+ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
10
  );