create-pixi-vn 2.0.8 → 2.0.9

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,7 +1,7 @@
1
1
  {
2
2
  "name": "create-pixi-vn",
3
3
  "description": "Create a new Pixi’VN project",
4
- "version": "2.0.8",
4
+ "version": "2.0.9",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0",
7
7
  "author": "DRincs-Productions",
@@ -19,7 +19,7 @@ import assetPackConfig from "./.assetpack.ts";
19
19
  const CACHED_EXTERNAL_HOSTNAMES: string[] = ["raw.githubusercontent.com"];
20
20
 
21
21
  // https://vite.dev/config/
22
- export default defineConfig({
22
+ export default defineConfig(({ mode }) => ({
23
23
  plugins: [
24
24
  assetpackPlugin(),
25
25
  checker({
@@ -27,7 +27,7 @@ export default defineConfig({
27
27
  tsconfigPath: "tsconfig.app.json",
28
28
  },
29
29
  }),
30
- devtools(),
30
+ mode !== "production" && devtools(),
31
31
  tanstackRouter({ target: "react", autoCodeSplitting: true }),
32
32
  react(),
33
33
  tailwindcss(),
@@ -112,7 +112,7 @@ export default defineConfig({
112
112
  },
113
113
  },
114
114
  },
115
- });
115
+ }));
116
116
 
117
117
  function assetpackPlugin(): Plugin {
118
118
  let mode: ResolvedConfig["command"];
@@ -20,7 +20,7 @@ import assetPackConfig from "./.assetpack.ts";
20
20
  const CACHED_EXTERNAL_HOSTNAMES: string[] = ["raw.githubusercontent.com"];
21
21
 
22
22
  // https://vite.dev/config/
23
- export default defineConfig({
23
+ export default defineConfig(({ mode }) => ({
24
24
  plugins: [
25
25
  assetpackPlugin(),
26
26
  checker({
@@ -28,7 +28,7 @@ export default defineConfig({
28
28
  tsconfigPath: "tsconfig.app.json",
29
29
  },
30
30
  }),
31
- devtools(),
31
+ mode !== "production" && devtools(),
32
32
  tanstackRouter({ target: "react", autoCodeSplitting: true }),
33
33
  react(),
34
34
  tailwindcss(),
@@ -118,7 +118,7 @@ export default defineConfig({
118
118
  },
119
119
  },
120
120
  },
121
- });
121
+ }));
122
122
 
123
123
  function assetpackPlugin(): Plugin {
124
124
  let mode: ResolvedConfig["command"];
@@ -1,6 +1,9 @@
1
1
  import type { AssetPackConfig } from "@assetpack/core";
2
2
  import { pixiPipes } from "@assetpack/core/pixi";
3
3
 
4
+ // TAURI_ENV_TARGET_TRIPLE is set by `tauri build` before running beforeBuildCommand
5
+ const isTauri = !!process.env.TAURI_ENV_TARGET_TRIPLE;
6
+
4
7
  const config: AssetPackConfig = {
5
8
  entry: "./src/assets",
6
9
  output: "./public/assets",
@@ -11,6 +14,12 @@ const config: AssetPackConfig = {
11
14
  output: "src/assets/manifest.gen.json",
12
15
  createShortcuts: true,
13
16
  },
17
+ // For Tauri: skip @0.5x mipmaps (unused on desktop, WebView handles DPR)
18
+ resolutions: isTauri ? { default: 1 } : undefined,
19
+ // For Tauri: raise WebP quality — files are local so bandwidth is not a concern
20
+ compression: isTauri
21
+ ? { png: true, jpg: true, webp: { quality: 88, alphaQuality: 88 } }
22
+ : undefined,
14
23
  }),
15
24
  ],
16
25
  };
@@ -41,3 +41,10 @@ serde = { version = "1", features = ["derive"] }
41
41
  serde_json = "1"
42
42
  steamworks = { version = "0.13", optional = true }
43
43
 
44
+ [profile.release]
45
+ opt-level = "z" # max runtime performance
46
+ lto = true # link-time optimization — removes dead code across crates
47
+ codegen-units = 1 # slower compile, smaller output
48
+ panic = "abort" # no stack unwinding machinery
49
+ strip = true # strip symbols from the binary
50
+
@@ -22,7 +22,7 @@ const CACHED_EXTERNAL_HOSTNAMES: string[] = ["raw.githubusercontent.com"];
22
22
  const host = process.env.TAURI_DEV_HOST;
23
23
 
24
24
  // https://vite.dev/config/
25
- export default defineConfig({
25
+ export default defineConfig(({ mode }) => ({
26
26
  plugins: [
27
27
  assetpackPlugin(),
28
28
  checker({
@@ -30,7 +30,7 @@ export default defineConfig({
30
30
  tsconfigPath: "tsconfig.app.json",
31
31
  },
32
32
  }),
33
- devtools(),
33
+ mode !== "production" && devtools(),
34
34
  tanstackRouter({ target: "react", autoCodeSplitting: true }),
35
35
  react(),
36
36
  tailwindcss(),
@@ -142,7 +142,7 @@ export default defineConfig({
142
142
  ignored: ["**/src-tauri/**"],
143
143
  },
144
144
  },
145
- });
145
+ }));
146
146
 
147
147
  function assetpackPlugin(): Plugin {
148
148
  let mode: ResolvedConfig["command"];
@@ -1,6 +1,9 @@
1
1
  import type { AssetPackConfig } from "@assetpack/core";
2
2
  import { pixiPipes } from "@assetpack/core/pixi";
3
3
 
4
+ // TAURI_ENV_TARGET_TRIPLE is set by `tauri build` before running beforeBuildCommand
5
+ const isTauri = !!process.env.TAURI_ENV_TARGET_TRIPLE;
6
+
4
7
  const config: AssetPackConfig = {
5
8
  entry: "./src/assets",
6
9
  output: "./public/assets",
@@ -11,6 +14,12 @@ const config: AssetPackConfig = {
11
14
  output: "src/assets/manifest.gen.json",
12
15
  createShortcuts: true,
13
16
  },
17
+ // For Tauri: skip @0.5x mipmaps (unused on desktop, WebView handles DPR)
18
+ resolutions: isTauri ? { default: 1 } : undefined,
19
+ // For Tauri: raise WebP quality — files are local so bandwidth is not a concern
20
+ compression: isTauri
21
+ ? { png: true, jpg: true, webp: { quality: 88, alphaQuality: 88 } }
22
+ : undefined,
14
23
  }),
15
24
  ],
16
25
  };
@@ -41,3 +41,10 @@ serde = { version = "1", features = ["derive"] }
41
41
  serde_json = "1"
42
42
  steamworks = { version = "0.13", optional = true }
43
43
 
44
+ [profile.release]
45
+ opt-level = "z" # max runtime performance
46
+ lto = true # link-time optimization — removes dead code across crates
47
+ codegen-units = 1 # slower compile, smaller output
48
+ panic = "abort" # no stack unwinding machinery
49
+ strip = true # strip symbols from the binary
50
+
@@ -21,7 +21,7 @@ const CACHED_EXTERNAL_HOSTNAMES: string[] = ["raw.githubusercontent.com"];
21
21
  const host = process.env.TAURI_DEV_HOST;
22
22
 
23
23
  // https://vite.dev/config/
24
- export default defineConfig({
24
+ export default defineConfig(({ mode }) => ({
25
25
  plugins: [
26
26
  assetpackPlugin(),
27
27
  checker({
@@ -29,7 +29,7 @@ export default defineConfig({
29
29
  tsconfigPath: "tsconfig.app.json",
30
30
  },
31
31
  }),
32
- devtools(),
32
+ mode !== "production" && devtools(),
33
33
  tanstackRouter({ target: "react", autoCodeSplitting: true }),
34
34
  react(),
35
35
  tailwindcss(),
@@ -136,7 +136,7 @@ export default defineConfig({
136
136
  ignored: ["**/src-tauri/**"],
137
137
  },
138
138
  },
139
- });
139
+ }));
140
140
 
141
141
  function assetpackPlugin(): Plugin {
142
142
  let mode: ResolvedConfig["command"];