create-rspack 0.7.6-canary-1a0d77d-20240627143904 → 1.0.0-alpha.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <picture>
2
- <source media="(prefers-color-scheme: dark)" srcset="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610-dark.png">
3
- <img alt="Rspack Banner" src="https://lf3-static.bytednsdoc.com/obj/eden-cn/rjhwzy/ljhwZthlaukjlkulzlp/rspack-banner-1610.png">
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://assets.rspack.dev/rspack/rspack-banner-plain-dark.png">
3
+ <img alt="Rspack Banner" src="https://assets.rspack.dev/rspack/rspack-banner-plain-light.png">
4
4
  </picture>
5
5
 
6
6
  # create-rspack
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "create-rspack",
3
- "version": "0.7.6-canary-1a0d77d-20240627143904",
3
+ "version": "1.0.0-alpha.0",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "create-rspack": "index.js"
8
8
  },
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "provenance": true
12
+ },
9
13
  "homepage": "https://rspack.dev",
10
14
  "bugs": "https://github.com/web-infra-dev/rspack/issues",
11
15
  "repository": {
@@ -1,10 +1,13 @@
1
- const rspack = require("@rspack/core");
2
- const refreshPlugin = require("@rspack/plugin-react-refresh");
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { defineConfig } from "@rspack/cli";
4
+ import { rspack } from "@rspack/core";
5
+ import RefreshPlugin from "@rspack/plugin-react-refresh";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
3
8
  const isDev = process.env.NODE_ENV === "development";
4
- /**
5
- * @type {import('@rspack/cli').Configuration}
6
- */
7
- module.exports = {
9
+
10
+ export default defineConfig({
8
11
  context: __dirname,
9
12
  entry: {
10
13
  main: "./src/main.jsx"
@@ -59,6 +62,9 @@ module.exports = {
59
62
  new rspack.HtmlRspackPlugin({
60
63
  template: "./index.html"
61
64
  }),
62
- isDev ? new refreshPlugin() : null
63
- ].filter(Boolean)
64
- };
65
+ isDev ? new RefreshPlugin() : null
66
+ ].filter(Boolean),
67
+ experiments: {
68
+ css: true
69
+ }
70
+ });
@@ -16,6 +16,8 @@
16
16
  "@rspack/plugin-react-refresh": "workspace:*",
17
17
  "@types/react": "^18.2.48",
18
18
  "@types/react-dom": "^18.2.18",
19
- "react-refresh": "^0.14.0"
19
+ "react-refresh": "^0.14.0",
20
+ "ts-node": "^10.9.2",
21
+ "typescript": "^5.3.3"
20
22
  }
21
23
  }
@@ -1,10 +1,10 @@
1
- const rspack = require("@rspack/core");
2
- const refreshPlugin = require("@rspack/plugin-react-refresh");
1
+ import { defineConfig } from "@rspack/cli";
2
+ import { rspack } from "@rspack/core";
3
+ import * as RefreshPlugin from "@rspack/plugin-react-refresh";
4
+
3
5
  const isDev = process.env.NODE_ENV === "development";
4
- /**
5
- * @type {import('@rspack/cli').Configuration}
6
- */
7
- module.exports = {
6
+
7
+ export default defineConfig({
8
8
  context: __dirname,
9
9
  entry: {
10
10
  main: "./src/main.tsx"
@@ -59,6 +59,9 @@ module.exports = {
59
59
  new rspack.HtmlRspackPlugin({
60
60
  template: "./index.html"
61
61
  }),
62
- isDev ? new refreshPlugin() : null
63
- ].filter(Boolean)
64
- };
62
+ isDev ? new RefreshPlugin() : null
63
+ ].filter(Boolean),
64
+ experiments: {
65
+ css: true
66
+ }
67
+ });
@@ -1,18 +1,22 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES6",
4
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
3
+ "target": "ES2020",
4
+ "lib": ["DOM", "ES2020"],
5
5
  "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowImportingTsExtensions": true,
8
- "resolveJsonModule": true,
9
- "isolatedModules": true,
10
- "noEmit": true,
11
6
  "jsx": "react-jsx",
12
7
  "strict": true,
13
- "noUnusedLocals": true,
14
- "noUnusedParameters": true,
15
- "noFallthroughCasesInSwitch": true
8
+ "noEmit": true,
9
+ "skipLibCheck": true,
10
+ "isolatedModules": true,
11
+ "resolveJsonModule": true,
12
+ "moduleResolution": "bundler",
13
+ "useDefineForClassFields": true,
14
+ "allowImportingTsExtensions": true
16
15
  },
17
- "include": ["src"]
16
+ "include": ["src"],
17
+ "ts-node": {
18
+ "compilerOptions": {
19
+ "module": "CommonJS"
20
+ }
21
+ }
18
22
  }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from "@rspack/cli";
2
+ import { rspack } from "@rspack/core";
3
+
4
+ export default defineConfig({
5
+ entry: {
6
+ main: "./src/index.js"
7
+ },
8
+ plugins: [new rspack.HtmlRspackPlugin({ template: "./index.html" })]
9
+ });
@@ -1,12 +1,10 @@
1
1
  {
2
2
  "name": "rspack-vue-starter",
3
3
  "version": "1.0.0",
4
- "description": "",
5
4
  "private": true,
6
- "main": "index.js",
7
5
  "scripts": {
8
- "dev": "rspack serve",
9
- "build": "rspack build"
6
+ "dev": "NODE_ENV=development rspack serve",
7
+ "build": "NODE_ENV=production rspack build"
10
8
  },
11
9
  "dependencies": {
12
10
  "vue": "3.2.45"
@@ -15,8 +13,5 @@
15
13
  "@rspack/cli": "workspace:*",
16
14
  "@rspack/core": "workspace:*",
17
15
  "vue-loader": "^17.2.2"
18
- },
19
- "keywords": [],
20
- "author": "",
21
- "license": "ISC"
16
+ }
22
17
  }
@@ -1,19 +1,27 @@
1
- const rspack = require("@rspack/core");
2
- const { VueLoaderPlugin } = require("vue-loader");
3
- const isDev = process.env.NODE_ENV == "development";
4
- /** @type {import('@rspack/cli').Configuration} */
5
- const config = {
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { defineConfig } from "@rspack/cli";
4
+ import { rspack } from "@rspack/core";
5
+ import { VueLoaderPlugin } from "vue-loader";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+
9
+ export default defineConfig({
6
10
  context: __dirname,
7
11
  entry: {
8
12
  main: "./src/main.js"
9
13
  },
10
14
  resolve: {
11
- extensions: ["...", ".ts"]
15
+ extensions: ["...", ".ts", ".vue"]
12
16
  },
13
17
  plugins: [
14
18
  new VueLoaderPlugin(),
15
19
  new rspack.HtmlRspackPlugin({
16
20
  template: "./index.html"
21
+ }),
22
+ new rspack.DefinePlugin({
23
+ __VUE_OPTIONS_API__: true,
24
+ __VUE_PROD_DEVTOOLS__: false
17
25
  })
18
26
  ],
19
27
  module: {
@@ -33,8 +41,7 @@ const config = {
33
41
  options: {
34
42
  jsc: {
35
43
  parser: {
36
- syntax: "typescript",
37
- tsx: false
44
+ syntax: "typescript"
38
45
  }
39
46
  },
40
47
  env: {
@@ -54,6 +61,8 @@ const config = {
54
61
  type: "asset/resource"
55
62
  }
56
63
  ]
64
+ },
65
+ experiments: {
66
+ css: true
57
67
  }
58
- };
59
- module.exports = config;
68
+ });
@@ -1,7 +1,5 @@
1
1
  import "./style.css";
2
-
3
2
  import { createApp } from "vue";
4
-
5
3
  import App from "./App.vue";
6
4
 
7
5
  createApp(App).mount("#app");
@@ -1,12 +1,10 @@
1
1
  {
2
- "name": "rspack-vue-starter",
2
+ "name": "rspack-vue-ts-starter",
3
3
  "version": "1.0.0",
4
- "description": "",
5
4
  "private": true,
6
- "main": "index.js",
7
5
  "scripts": {
8
- "dev": "rspack serve",
9
- "build": "rspack build"
6
+ "dev": "NODE_ENV=development rspack serve",
7
+ "build": "NODE_ENV=production rspack build"
10
8
  },
11
9
  "dependencies": {
12
10
  "vue": "3.4.21"
@@ -14,11 +12,8 @@
14
12
  "devDependencies": {
15
13
  "@rspack/cli": "workspace:*",
16
14
  "@rspack/core": "workspace:*",
17
- "vue-loader": "^17.2.2",
18
15
  "ts-node": "^10.9.2",
19
- "typescript": "^5.3.3"
20
- },
21
- "keywords": [],
22
- "author": "",
23
- "license": "ISC"
24
- }
16
+ "typescript": "^5.3.3",
17
+ "vue-loader": "^17.2.2"
18
+ }
19
+ }
@@ -1,28 +1,23 @@
1
- import {
2
- Configuration,
3
- DefinePlugin,
4
- HtmlRspackPlugin,
5
- RspackPluginFunction
6
- } from "@rspack/core";
1
+ import { defineConfig } from "@rspack/cli";
2
+ import { type RspackPluginFunction, rspack } from "@rspack/core";
7
3
  import { VueLoaderPlugin } from "vue-loader";
8
4
 
9
- const isDev = process.env.NODE_ENV == "development";
10
-
11
- const config: Configuration = {
5
+ export default defineConfig({
12
6
  context: __dirname,
13
7
  entry: {
14
8
  main: "./src/main.ts"
15
9
  },
16
10
  resolve: {
17
- extensions: ["...", ".ts"]
11
+ extensions: ["...", ".ts", ".vue"]
18
12
  },
19
13
  plugins: [
20
14
  new VueLoaderPlugin() as RspackPluginFunction,
21
- new HtmlRspackPlugin({
15
+ new rspack.HtmlRspackPlugin({
22
16
  template: "./index.html"
23
17
  }),
24
- new DefinePlugin({
25
- __VUE_PROD_DEVTOOLS__: isDev
18
+ new rspack.DefinePlugin({
19
+ __VUE_OPTIONS_API__: true,
20
+ __VUE_PROD_DEVTOOLS__: false
26
21
  })
27
22
  ],
28
23
  module: {
@@ -43,8 +38,7 @@ const config: Configuration = {
43
38
  sourceMap: true,
44
39
  jsc: {
45
40
  parser: {
46
- syntax: "typescript",
47
- tsx: false
41
+ syntax: "typescript"
48
42
  }
49
43
  },
50
44
  env: {
@@ -64,7 +58,8 @@ const config: Configuration = {
64
58
  type: "asset/resource"
65
59
  }
66
60
  ]
61
+ },
62
+ experiments: {
63
+ css: true
67
64
  }
68
- };
69
-
70
- export default config;
65
+ });
@@ -1,7 +1,5 @@
1
1
  import "./style.css";
2
-
3
2
  import { createApp } from "vue";
4
-
5
3
  import App from "./App.vue";
6
4
 
7
5
  createApp(App).mount("#app");
@@ -1,20 +1,23 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2020",
4
- "lib": [
5
- "DOM",
6
- "ES2020"
7
- ],
8
- "module": "CommonJS",
4
+ "lib": ["DOM", "ES2020"],
5
+ "module": "ESNext",
9
6
  "jsx": "preserve",
10
7
  "jsxImportSource": "vue",
11
8
  "strict": true,
9
+ "noEmit": true,
12
10
  "skipLibCheck": true,
13
11
  "isolatedModules": true,
14
12
  "resolveJsonModule": true,
15
- "useDefineForClassFields": true
13
+ "moduleResolution": "bundler",
14
+ "useDefineForClassFields": true,
15
+ "allowImportingTsExtensions": true
16
16
  },
17
- "include": [
18
- "src"
19
- ]
20
- }
17
+ "include": ["src"],
18
+ "ts-node": {
19
+ "compilerOptions": {
20
+ "module": "CommonJS"
21
+ }
22
+ }
23
+ }
@@ -1,7 +0,0 @@
1
- const rspack = require("@rspack/core");
2
- module.exports = {
3
- entry: {
4
- main: "./src/index.js"
5
- },
6
- plugins: [new rspack.HtmlRspackPlugin({ template: "./index.html" })]
7
- };