create-rspack 1.0.0-beta.3 → 1.0.0-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rspack",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.5",
4
4
  "license": "MIT",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  "react-dom": "^18.2.0"
12
12
  },
13
13
  "devDependencies": {
14
- "@rspack/plugin-react-refresh": "workspace:*",
14
+ "@rspack/plugin-react-refresh": "1.0.0",
15
15
  "@rspack/cli": "workspace:*",
16
16
  "@rspack/core": "workspace:*",
17
17
  "@types/react": "^18.2.48",
@@ -19,4 +19,4 @@
19
19
  "cross-env": "^7.0.3",
20
20
  "react-refresh": "^0.14.0"
21
21
  }
22
- }
22
+ }
@@ -7,6 +7,9 @@ import RefreshPlugin from "@rspack/plugin-react-refresh";
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
  const isDev = process.env.NODE_ENV === "development";
9
9
 
10
+ // Target browsers, see: https://github.com/browserslist/browserslist
11
+ const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
12
+
10
13
  export default defineConfig({
11
14
  context: __dirname,
12
15
  entry: {
@@ -40,14 +43,7 @@ export default defineConfig({
40
43
  }
41
44
  }
42
45
  },
43
- env: {
44
- targets: [
45
- "chrome >= 87",
46
- "edge >= 88",
47
- "firefox >= 78",
48
- "safari >= 14"
49
- ]
50
- }
46
+ env: { targets }
51
47
  }
52
48
  }
53
49
  ]
@@ -55,15 +51,19 @@ export default defineConfig({
55
51
  ]
56
52
  },
57
53
  plugins: [
58
- new rspack.DefinePlugin({
59
- "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
60
- }),
61
- new rspack.ProgressPlugin({}),
62
54
  new rspack.HtmlRspackPlugin({
63
55
  template: "./index.html"
64
56
  }),
65
57
  isDev ? new RefreshPlugin() : null
66
58
  ].filter(Boolean),
59
+ optimization: {
60
+ minimizer: [
61
+ new rspack.SwcJsMinimizerRspackPlugin(),
62
+ new rspack.LightningCssMinimizerRspackPlugin({
63
+ minimizerOptions: { targets }
64
+ })
65
+ ]
66
+ },
67
67
  experiments: {
68
68
  css: true
69
69
  }
@@ -13,7 +13,7 @@
13
13
  "devDependencies": {
14
14
  "@rspack/cli": "workspace:*",
15
15
  "@rspack/core": "workspace:*",
16
- "@rspack/plugin-react-refresh": "workspace:*",
16
+ "@rspack/plugin-react-refresh": "1.0.0",
17
17
  "@types/react": "^18.2.48",
18
18
  "@types/react-dom": "^18.2.18",
19
19
  "cross-env": "^7.0.3",
@@ -21,4 +21,4 @@
21
21
  "ts-node": "^10.9.2",
22
22
  "typescript": "^5.3.3"
23
23
  }
24
- }
24
+ }
@@ -4,6 +4,9 @@ import * as RefreshPlugin from "@rspack/plugin-react-refresh";
4
4
 
5
5
  const isDev = process.env.NODE_ENV === "development";
6
6
 
7
+ // Target browsers, see: https://github.com/browserslist/browserslist
8
+ const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
9
+
7
10
  export default defineConfig({
8
11
  context: __dirname,
9
12
  entry: {
@@ -37,14 +40,7 @@ export default defineConfig({
37
40
  }
38
41
  }
39
42
  },
40
- env: {
41
- targets: [
42
- "chrome >= 87",
43
- "edge >= 88",
44
- "firefox >= 78",
45
- "safari >= 14"
46
- ]
47
- }
43
+ env: { targets }
48
44
  }
49
45
  }
50
46
  ]
@@ -52,15 +48,19 @@ export default defineConfig({
52
48
  ]
53
49
  },
54
50
  plugins: [
55
- new rspack.DefinePlugin({
56
- "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV)
57
- }),
58
- new rspack.ProgressPlugin({}),
59
51
  new rspack.HtmlRspackPlugin({
60
52
  template: "./index.html"
61
53
  }),
62
54
  isDev ? new RefreshPlugin() : null
63
55
  ].filter(Boolean),
56
+ optimization: {
57
+ minimizer: [
58
+ new rspack.SwcJsMinimizerRspackPlugin(),
59
+ new rspack.LightningCssMinimizerRspackPlugin({
60
+ minimizerOptions: { targets }
61
+ })
62
+ ]
63
+ },
64
64
  experiments: {
65
65
  css: true
66
66
  }
@@ -1,6 +1,7 @@
1
1
  import { defineConfig } from "@rspack/cli";
2
2
  import { rspack } from "@rspack/core";
3
3
 
4
+ // Target browsers, see: https://github.com/browserslist/browserslist
4
5
  const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
5
6
 
6
7
  export default defineConfig({
@@ -32,6 +33,14 @@ export default defineConfig({
32
33
  ]
33
34
  },
34
35
  plugins: [new rspack.HtmlRspackPlugin({ template: "./index.html" })],
36
+ optimization: {
37
+ minimizer: [
38
+ new rspack.SwcJsMinimizerRspackPlugin(),
39
+ new rspack.LightningCssMinimizerRspackPlugin({
40
+ minimizerOptions: { targets }
41
+ })
42
+ ]
43
+ },
35
44
  experiments: {
36
45
  css: true
37
46
  }
@@ -1,6 +1,7 @@
1
1
  import { defineConfig } from "@rspack/cli";
2
2
  import { rspack } from "@rspack/core";
3
3
 
4
+ // Target browsers, see: https://github.com/browserslist/browserslist
4
5
  const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
5
6
 
6
7
  export default defineConfig({
@@ -51,6 +52,14 @@ export default defineConfig({
51
52
  ]
52
53
  },
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
+ },
54
63
  experiments: {
55
64
  css: true
56
65
  }
@@ -6,6 +6,9 @@ import { VueLoaderPlugin } from "vue-loader";
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
 
9
+ // Target browsers, see: https://github.com/browserslist/browserslist
10
+ const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
11
+
9
12
  export default defineConfig({
10
13
  context: __dirname,
11
14
  entry: {
@@ -14,16 +17,6 @@ export default defineConfig({
14
17
  resolve: {
15
18
  extensions: ["...", ".ts", ".vue"]
16
19
  },
17
- plugins: [
18
- new VueLoaderPlugin(),
19
- new rspack.HtmlRspackPlugin({
20
- template: "./index.html"
21
- }),
22
- new rspack.DefinePlugin({
23
- __VUE_OPTIONS_API__: true,
24
- __VUE_PROD_DEVTOOLS__: false
25
- })
26
- ],
27
20
  module: {
28
21
  rules: [
29
22
  {
@@ -44,14 +37,7 @@ export default defineConfig({
44
37
  syntax: "typescript"
45
38
  }
46
39
  },
47
- env: {
48
- targets: [
49
- "chrome >= 87",
50
- "edge >= 88",
51
- "firefox >= 78",
52
- "safari >= 14"
53
- ]
54
- }
40
+ env: { targets }
55
41
  }
56
42
  }
57
43
  ]
@@ -62,6 +48,24 @@ export default defineConfig({
62
48
  }
63
49
  ]
64
50
  },
51
+ plugins: [
52
+ new rspack.HtmlRspackPlugin({
53
+ template: "./index.html"
54
+ }),
55
+ new rspack.DefinePlugin({
56
+ __VUE_OPTIONS_API__: true,
57
+ __VUE_PROD_DEVTOOLS__: false
58
+ }),
59
+ new VueLoaderPlugin()
60
+ ],
61
+ optimization: {
62
+ minimizer: [
63
+ new rspack.SwcJsMinimizerRspackPlugin(),
64
+ new rspack.LightningCssMinimizerRspackPlugin({
65
+ minimizerOptions: { targets }
66
+ })
67
+ ]
68
+ },
65
69
  experiments: {
66
70
  css: true
67
71
  }
@@ -2,6 +2,9 @@ import { defineConfig } from "@rspack/cli";
2
2
  import { type RspackPluginFunction, rspack } from "@rspack/core";
3
3
  import { VueLoaderPlugin } from "vue-loader";
4
4
 
5
+ // Target browsers, see: https://github.com/browserslist/browserslist
6
+ const targets = ["chrome >= 87", "edge >= 88", "firefox >= 78", "safari >= 14"];
7
+
5
8
  export default defineConfig({
6
9
  context: __dirname,
7
10
  entry: {
@@ -10,16 +13,6 @@ export default defineConfig({
10
13
  resolve: {
11
14
  extensions: ["...", ".ts", ".vue"]
12
15
  },
13
- plugins: [
14
- new VueLoaderPlugin() as RspackPluginFunction,
15
- new rspack.HtmlRspackPlugin({
16
- template: "./index.html"
17
- }),
18
- new rspack.DefinePlugin({
19
- __VUE_OPTIONS_API__: true,
20
- __VUE_PROD_DEVTOOLS__: false
21
- })
22
- ],
23
16
  module: {
24
17
  rules: [
25
18
  {
@@ -41,14 +34,7 @@ export default defineConfig({
41
34
  syntax: "typescript"
42
35
  }
43
36
  },
44
- env: {
45
- targets: [
46
- "chrome >= 87",
47
- "edge >= 88",
48
- "firefox >= 78",
49
- "safari >= 14"
50
- ]
51
- }
37
+ env: { targets }
52
38
  }
53
39
  }
54
40
  ]
@@ -59,6 +45,24 @@ export default defineConfig({
59
45
  }
60
46
  ]
61
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() as RspackPluginFunction
57
+ ],
58
+ optimization: {
59
+ minimizer: [
60
+ new rspack.SwcJsMinimizerRspackPlugin(),
61
+ new rspack.LightningCssMinimizerRspackPlugin({
62
+ minimizerOptions: { targets }
63
+ })
64
+ ]
65
+ },
62
66
  experiments: {
63
67
  css: true
64
68
  }