emsdk-env 0.2.0 → 0.4.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 +21 -4
- package/dist/__vite-browser-external-2Ng8QIWW.js +15 -0
- package/dist/__vite-browser-external-2Ng8QIWW.js.map +1 -0
- package/dist/__vite-browser-external-DES75WN9.cjs +15 -0
- package/dist/__vite-browser-external-DES75WN9.cjs.map +1 -0
- package/dist/{build-oenTJc-4.cjs → build-DwIdyC2W.cjs} +403 -80
- package/dist/build-DwIdyC2W.cjs.map +1 -0
- package/dist/{build-qp0IEBnb.js → build-oSzNI6Av.js} +405 -82
- package/dist/build-oSzNI6Av.js.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +197 -33
- package/dist/index.mjs +3 -3
- package/dist/vite.cjs +32 -8
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.ts +183 -27
- package/dist/vite.mjs +32 -8
- package/dist/vite.mjs.map +1 -1
- package/package.json +7 -7
- package/dist/build-oenTJc-4.cjs.map +0 -1
- package/dist/build-qp0IEBnb.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,14 +9,13 @@ A Vite plugin that automatically builds WASM C/C++ source code using the Emscrip
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
WIP:
|
|
13
|
-
|
|
14
12
|
## What is this?
|
|
15
13
|
|
|
16
|
-
This is a Vite plugin that automatically downloads and manages the Emscripten SDK,
|
|
14
|
+
This is a Vite plugin that automatically downloads and manages the [Emscripten SDK](https://github.com/emscripten-core/emsdk),
|
|
15
|
+
and makes it possible to automatically build WASM C/C++ code in your project.
|
|
17
16
|
With this plugin, you can easily set up a WASM C/C++ development environment in your Vite project.
|
|
18
17
|
|
|
19
|
-
Usage is simple. Just add this Vite plugin package to your project and initialize the plugin in `vite.config
|
|
18
|
+
Usage is simple. Just add this Vite plugin package to your project and initialize the plugin in `vite.config` like this:
|
|
20
19
|
|
|
21
20
|
```typescript
|
|
22
21
|
// `vite.config.ts`
|
|
@@ -57,6 +56,8 @@ You can focus on writing C/C++ code just like you would TypeScript/JavaScript co
|
|
|
57
56
|
- Simplified specification of export symbols
|
|
58
57
|
- Ability to generate multiple target WASM binaries
|
|
59
58
|
- Customizable directory paths, compile options, and linker options
|
|
59
|
+
- Archive libraries (`*.a`) can be built and referenced
|
|
60
|
+
- WASM libraries can be distributed and referenced via NPM packages
|
|
60
61
|
|
|
61
62
|
---
|
|
62
63
|
|
|
@@ -70,6 +71,9 @@ Add to `devDependencies` (emsdk-env itself does not require runtime code):
|
|
|
70
71
|
$ npm install -D emsdk-env
|
|
71
72
|
```
|
|
72
73
|
|
|
74
|
+
- emsdk-env automatically downloads and caches the Emscripten SDK (located under `~/.cache/emsdk-env/`).
|
|
75
|
+
Therefore, you do not need to manually set up the Emscripten SDK.
|
|
76
|
+
|
|
73
77
|
### C/C++ Source Code and Binary Placement
|
|
74
78
|
|
|
75
79
|
By default, C/C++ source code is placed in the `wasm/` directory under your project,
|
|
@@ -88,6 +92,19 @@ project/
|
|
|
88
92
|
└── add.c
|
|
89
93
|
```
|
|
90
94
|
|
|
95
|
+
- In addition to the above, a temporary build directory is created under the OS temp directory.
|
|
96
|
+
The default location is `${TMPDIR}/emsdk-env` (typically `/tmp/emsdk-env` on Unix).
|
|
97
|
+
This directory is used during the build process and is typically deleted after the build completes.
|
|
98
|
+
If you override `buildDir` to point inside the project, add it to `.gitignore`.
|
|
99
|
+
|
|
100
|
+
Of course, you can change these. Specify them in the Vite plugin options.
|
|
101
|
+
|
|
102
|
+
You might find it odd that the built binary is placed in `src/wasm/`, but this is because the Vite server defaults to a path where it can easily access WASM binaries.
|
|
103
|
+
|
|
104
|
+
If you plan to operate with the default settings, there is essentially no configuration work required.
|
|
105
|
+
|
|
106
|
+
Other topics include features such as explicitly specifying source files, applying multiple compile options separately, handling multiple target outputs, generating and referencing archive library files, and compilation and referencing NPM packages.
|
|
107
|
+
|
|
91
108
|
### Documents
|
|
92
109
|
|
|
93
110
|
For more information, please visit repository and refer README: [emsdk-env](https://github.com/kekyo/emsdk-env)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* name: emsdk-env
|
|
3
|
+
* version: 0.4.0
|
|
4
|
+
* description: Emscripten environment builder
|
|
5
|
+
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
|
+
* license: MIT
|
|
7
|
+
* repository.url: https://github.com/kekyo/emsdk-env
|
|
8
|
+
* git.commit.hash: cd0d8e53bf52b98940dd50343a9d3a39200306bd
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const __viteBrowserExternal = {};
|
|
12
|
+
export {
|
|
13
|
+
__viteBrowserExternal as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=__vite-browser-external-2Ng8QIWW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__vite-browser-external-2Ng8QIWW.js","sources":["../__vite-browser-external"],"sourcesContent":["export default {}"],"names":[],"mappings":";;;;;;;;;;AAAA,MAAA,wBAAe,CAAA;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* name: emsdk-env
|
|
3
|
+
* version: 0.4.0
|
|
4
|
+
* description: Emscripten environment builder
|
|
5
|
+
* author: Kouji Matsui (@kekyo@mi.kekyo.net)
|
|
6
|
+
* license: MIT
|
|
7
|
+
* repository.url: https://github.com/kekyo/emsdk-env
|
|
8
|
+
* git.commit.hash: cd0d8e53bf52b98940dd50343a9d3a39200306bd
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
"use strict";
|
|
12
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
const __viteBrowserExternal = {};
|
|
14
|
+
exports.default = __viteBrowserExternal;
|
|
15
|
+
//# sourceMappingURL=__vite-browser-external-DES75WN9.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__vite-browser-external-DES75WN9.cjs","sources":["../__vite-browser-external"],"sourcesContent":["export default {}"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAA,wBAAe,CAAA;;"}
|