Skip to content

Commit 091f614

Browse files
author
Kim Wallmark
committed
Add information about additional generated files.
wasm_game_of_life_bg.js and wasm_game_of_life_bg.wasm.d.ts are now being generated by `wasm-pack build`. There is some additional information about these files in rustwasm/wasm-pack#199 and rustwasm/wasm-pack#1193 .
1 parent 366042a commit 091f614

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/game-of-life/hello-world.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ and it should have these contents:
112112
pkg/
113113
├── package.json
114114
├── README.md
115+
├── wasm_game_of_life_bg.js
115116
├── wasm_game_of_life_bg.wasm
117+
├── wasm_game_of_life_bg.wasm.d.ts
116118
├── wasm_game_of_life.d.ts
117119
└── wasm_game_of_life.js
118120
```
@@ -147,12 +149,18 @@ export function greet() {
147149
}
148150
```
149151

150-
### `wasm-game-of-life/pkg/wasm_game_of_life.d.ts`
152+
### `wasm-game-of-life/pkg/wasm_game_of_life_bg.js`
151153

152-
The `.d.ts` file contains [TypeScript][] type declarations for the JavaScript
153-
glue. If you are using TypeScript, you can have your calls into WebAssembly
154-
functions type checked, and your IDE can provide autocompletions and
155-
suggestions! If you aren't using TypeScript, you can safely ignore this file.
154+
This `_bg.js` file contains shim code that allows the `_bg.wasm` code to be
155+
required as a module in Node.js.
156+
157+
### `wasm-game-of-life/pkg/wasm_game_of_life.d.ts` and `wasm-game-of-life/pkg/wasm_game_of_life_bg.wasm.d.ts`
158+
159+
These `.d.ts` files contain [TypeScript][] type declarations for the JavaScript
160+
glue and the wasm code. If you are using TypeScript, you can have your calls
161+
into WebAssembly functions type checked, and your IDE can provide
162+
autocompletions and suggestions! If you aren't using TypeScript, you can safely
163+
ignore these files.
156164

157165
```typescript
158166
export function greet(): void;

0 commit comments

Comments
 (0)