@yamachu/vite-plugin-dotnet-wasm 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yamachu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # vite-plugin-dotnet-wasm
2
+
3
+ Vite plugin for .NET WebAssembly projects.
4
+ It supports building and serving .NET WebAssembly projects with Vite.
5
+
6
+ ## Installation
7
+
8
+ ```bash
9
+ pnpm add -D @yamachu/vite-plugin-dotnet-wasm
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```ts
15
+ // vite.config.ts
16
+ import { defineConfig } from "vite";
17
+ import dotnetWasm from "@yamachu/vite-plugin-dotnet-wasm";
18
+
19
+ export default defineConfig({
20
+ plugins: [
21
+ dotnetWasm({
22
+ /** Required */
23
+ projectPath: "./PATH/TO/DOTNET/WEBASSEMBLY/Project.csproj",
24
+ /** Optional */
25
+ configuration: "Release",
26
+ dotnetBuildArgs: [/* Additional arguments for dotnet build, default: undefined */],
27
+ watch: true, // Enable watch mode (dotnet watch build), if you want to build once and without watching .NET files changes, set to false
28
+ }),
29
+ ],
30
+ });
31
+ ```
32
+
33
+ And, see example project in the `examples/` folder.
34
+
35
+ ## LICENSE
36
+
37
+ MIT
@@ -0,0 +1,36 @@
1
+ import type { Plugin } from "vite";
2
+ export interface VitePluginDotnetWasmOptions {
3
+ /**
4
+ * Path to the .NET project file (e.g., .csproj).
5
+ */
6
+ projectPath: string;
7
+ /**
8
+ * Build configuration, either "Debug" or "Release".
9
+ * @default "Release"
10
+ */
11
+ configuration?: "Debug" | "Release";
12
+ /**
13
+ * Whether to start 'dotnet watch' for continuous building.
14
+ * @default true in dev mode
15
+ */
16
+ watch?: boolean;
17
+ /**
18
+ * Whether to keep the relative path to ./_framework/dotnet.js in import statements.
19
+ * If false, the path will be handled by Vite's bundle output method.
20
+ * @default true
21
+ */
22
+ keepDotnetScriptRelative?: boolean;
23
+ /**
24
+ * Additional arguments to pass to the 'dotnet build' command.
25
+ */
26
+ dotnetBuildArgs?: string[];
27
+ /**
28
+ * Alias for the framework path used in module resolution.
29
+ * @default (wwwroot) => ({ "./_framework": resolve(wwwroot, "_framework") })
30
+ */
31
+ frameworkPathAlias?: (wwwroot: string) => {
32
+ [alias: string]: string;
33
+ };
34
+ }
35
+ export default function vitePluginDotnetWasm(options: VitePluginDotnetWasmOptions): Plugin;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAMlE,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACvE;AAkED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,OAAO,EAAE,2BAA2B,GACnC,MAAM,CAuMR"}
package/dist/index.js ADDED
@@ -0,0 +1,200 @@
1
+ import { spawn, spawnSync } from "node:child_process";
2
+ import { cp } from "node:fs/promises";
3
+ import { basename, dirname, isAbsolute, resolve } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { searchForWorkspaceRoot } from "vite";
6
+ const pluginDir = dirname(fileURLToPath(import.meta.url));
7
+ const dumpTargets = resolve(pluginDir, "../resources/DumpInfo.targets");
8
+ const createDotnetBuildProcess = (projectFile, projectPath, configuration, watch, optionalArgs) => {
9
+ const args = [
10
+ "build",
11
+ projectFile,
12
+ "--configuration",
13
+ configuration,
14
+ ...(optionalArgs ?? []),
15
+ ];
16
+ if (watch) {
17
+ args.unshift("watch", "--non-interactive");
18
+ }
19
+ return spawn("dotnet", args, {
20
+ cwd: projectPath,
21
+ stdio: ["ignore", "pipe", "pipe"],
22
+ shell: true,
23
+ env: { ...process.env },
24
+ });
25
+ };
26
+ const getWwwRootPath = (projectPath, configuration) => {
27
+ const cwd = process.cwd();
28
+ const { error, output } = spawnSync("dotnet", [
29
+ "msbuild",
30
+ projectPath,
31
+ `-property:Configuration=${configuration}`,
32
+ `-property:CustomAfterMicrosoftCommonTargets=${dumpTargets}`,
33
+ "-t:PrintWwwroot",
34
+ "-v:d",
35
+ ], {
36
+ cwd,
37
+ stdio: ["ignore", "pipe", "pipe"],
38
+ shell: true,
39
+ });
40
+ if (error) {
41
+ throw error;
42
+ }
43
+ const stdout = output.toString();
44
+ const wwwrootMatch = /wwwroot path:\s*(.+)\s*/.exec(stdout);
45
+ if (wwwrootMatch && wwwrootMatch[1]) {
46
+ const matched = wwwrootMatch[1];
47
+ if (isAbsolute(matched)) {
48
+ return matched;
49
+ }
50
+ const projDirName = dirname(projectPath);
51
+ return resolve(cwd, projDirName, matched);
52
+ }
53
+ else {
54
+ throw new Error("Failed to detect wwwroot path from msbuild output.");
55
+ }
56
+ };
57
+ export default function vitePluginDotnetWasm(options) {
58
+ const { projectPath, configuration = "Release", watch: watchOption, keepDotnetScriptRelative = true, dotnetBuildArgs, frameworkPathAlias = (wwwroot) => ({
59
+ "./_framework": resolve(wwwroot, "_framework"),
60
+ }), } = options;
61
+ let server;
62
+ let config;
63
+ let dotnetProcess = null;
64
+ let wwwroot;
65
+ let projectFile;
66
+ let projectRoot;
67
+ return {
68
+ name: "vite-plugin-dotnet-wasm",
69
+ enforce: "pre",
70
+ config(prevConfig) {
71
+ try {
72
+ wwwroot = getWwwRootPath(projectPath, configuration);
73
+ }
74
+ catch (e) {
75
+ console.error(`[vite-plugin-dotnet-wasm] Failed to detect wwwroot path: ${e}`);
76
+ }
77
+ projectFile = basename(projectPath);
78
+ projectRoot = resolve(process.cwd(), dirname(projectPath));
79
+ const prevExternal = prevConfig.build?.rollupOptions?.external;
80
+ return {
81
+ resolve: {
82
+ alias: {
83
+ ...frameworkPathAlias(wwwroot),
84
+ },
85
+ },
86
+ server: {
87
+ fs: {
88
+ allow: [
89
+ searchForWorkspaceRoot(process.cwd()),
90
+ resolve(wwwroot, "_framework"),
91
+ ],
92
+ },
93
+ },
94
+ build: {
95
+ rollupOptions: {
96
+ external: prevExternal === undefined
97
+ ? [/^\.\/_framework\//]
98
+ : Array.isArray(prevExternal)
99
+ ? [...prevExternal, /^\.\/_framework\//]
100
+ : typeof prevExternal === "function"
101
+ ? (source, importer, isResolved) => {
102
+ return (prevExternal(source, importer, isResolved) ||
103
+ /^\.\/_framework\//.test(source));
104
+ }
105
+ : [prevExternal, /^\.\/_framework\//],
106
+ },
107
+ },
108
+ };
109
+ },
110
+ async configResolved(resolvedConfig) {
111
+ config = resolvedConfig;
112
+ },
113
+ async configureServer(viteServer) {
114
+ if (dotnetProcess)
115
+ return;
116
+ server = viteServer;
117
+ dotnetProcess = createDotnetBuildProcess(projectPath, projectRoot, configuration, watchOption ?? config.command === "serve", dotnetBuildArgs);
118
+ dotnetProcess.stdout?.on("data", (data) => {
119
+ const text = data.toString();
120
+ process.stdout.write(`[dotnet] ${text}`);
121
+ });
122
+ dotnetProcess.stderr?.on("data", (data) => {
123
+ const text = data.toString();
124
+ process.stderr.write(`[dotnet] ${text}\n`);
125
+ if (text.includes("Waiting for a file to change before restarting")) {
126
+ console.log(`[vite-plugin-dotnet-wasm] Build succeeded, triggering Vite server reload...`);
127
+ server.ws.send({
128
+ type: "full-reload",
129
+ });
130
+ }
131
+ });
132
+ dotnetProcess.on("close", (code) => {
133
+ console.log(`dotnet process exited with code ${code}`);
134
+ dotnetProcess = null;
135
+ });
136
+ dotnetProcess.on("error", (err) => {
137
+ console.error(`dotnet process error: ${err}`);
138
+ dotnetProcess = null;
139
+ });
140
+ server.httpServer?.once("close", () => {
141
+ if (dotnetProcess) {
142
+ dotnetProcess.kill();
143
+ dotnetProcess = null;
144
+ }
145
+ });
146
+ },
147
+ async generateBundle(options, bundle) {
148
+ const distFramework = resolve(config.root, config.build.outDir, config.build.assetsDir, "_framework");
149
+ try {
150
+ await new Promise((resolve) => {
151
+ createDotnetBuildProcess(projectFile, projectRoot, configuration, false, dotnetBuildArgs).on("close", (code) => {
152
+ resolve({});
153
+ });
154
+ });
155
+ await cp(resolve(wwwroot, "_framework"), distFramework, {
156
+ recursive: true,
157
+ });
158
+ console.log(`[vite-plugin-dotnet-wasm] Copied framework to ${distFramework}`);
159
+ }
160
+ catch (e) {
161
+ console.error(`[vite-plugin-dotnet-wasm] Failed to copy framework:`, e);
162
+ }
163
+ if (!keepDotnetScriptRelative) {
164
+ return;
165
+ }
166
+ // FIXME: Improve the rewriting logic to handle various import styles more robustly...
167
+ // TODO: Add tests for this rewriting logic.
168
+ for (const fileName of Object.keys(bundle)) {
169
+ const chunk = bundle[fileName];
170
+ if (chunk && chunk.type === "chunk" && typeof chunk.code === "string") {
171
+ let newCode = chunk.code;
172
+ // rewrite: import ... from "..."
173
+ newCode = newCode.replace(/(import\s*[^;]*?from\s*)(["'])([^"']*_framework\/dotnet\.js)\2/g, (match, p1, quote, importPath) => {
174
+ if (!importPath.startsWith("./_framework/dotnet.js")) {
175
+ return p1 + quote + "./_framework/dotnet.js" + quote;
176
+ }
177
+ return match;
178
+ });
179
+ // rewrite: import("..._framework/dotnet.js")
180
+ newCode = newCode.replace(/(import\s*\(\s*)(["'])([^"']*_framework\/dotnet\.js)\2(\s*\))/g, (match, p1, quote, importPath, p4) => {
181
+ if (!importPath.startsWith("./_framework/dotnet.js")) {
182
+ return p1 + quote + "./_framework/dotnet.js" + quote + p4;
183
+ }
184
+ return match;
185
+ });
186
+ if (newCode !== chunk.code) {
187
+ chunk.code = newCode;
188
+ }
189
+ }
190
+ }
191
+ },
192
+ async closeBundle() {
193
+ if (dotnetProcess) {
194
+ dotnetProcess.kill();
195
+ dotnetProcess = null;
196
+ }
197
+ },
198
+ };
199
+ }
200
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAqB,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;A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ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@yamachu/vite-plugin-dotnet-wasm",
3
+ "version": "0.1.0",
4
+ "description": "Vite plugin for .NET WebAssembly projects",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "resources",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json",
22
+ "prepare": "npm run build"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/yamachu/vite-plugin-dotnet-wasm.git"
27
+ },
28
+ "bugs": {
29
+ "url": "https://github.com/yamachu/vite-plugin-dotnet-wasm/issues"
30
+ },
31
+ "homepage": "https://github.com/yamachu/vite-plugin-dotnet-wasm#readme",
32
+ "keywords": ["vite-plugin", "dotnet", "vite"],
33
+ "author": "yamachu",
34
+ "license": "MIT",
35
+ "packageManager": "pnpm@10.17.1",
36
+ "devDependencies": {
37
+ "@types/node": "24.10.4",
38
+ "typescript": "5.9.3",
39
+ "vite": "7.2.6"
40
+ }
41
+ }
@@ -0,0 +1,5 @@
1
+ <Project>
2
+ <Target Name="PrintWwwroot">
3
+ <Message Importance="High" Text="wwwroot path: $(OutputPath)wwwroot" />
4
+ </Target>
5
+ </Project>