Skip to content

Commit 34f0967

Browse files
committed
fix workflow AGAIN
1 parent de052ea commit 34f0967

2 files changed

Lines changed: 34 additions & 31 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
"webpack-cli": "^5.1.4",
1111
"webpack-dev-server": "^5.0.4"
1212
}
13-
}
13+
}

webpack.config.js

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
1-
const path = require('path');
2-
const HtmlWebpackPlugin = require('html-webpack-plugin');
3-
const webpack = require('webpack');
1+
const HtmlWebpackPlugin = require("html-webpack-plugin");
42
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
53

64
module.exports = {
7-
entry: './index.js',
8-
output: {
9-
path: path.resolve(__dirname, 'dist'),
10-
filename: 'bundle.js', // changed from index.js to avoid conflicts
11-
},
12-
plugins: [
13-
new HtmlWebpackPlugin({
14-
template: 'index.html'
15-
}),
16-
new WasmPackPlugin({
17-
crateDirectory: path.resolve(__dirname, ".")
18-
}),
5+
entry: "./index.js", // Change this to your JS entry point if different
6+
output: {
7+
path: __dirname + "/dist",
8+
filename: "bundle.js",
9+
},
10+
mode: "development", // Or "production"
11+
experiments: {
12+
asyncWebAssembly: true,
13+
},
14+
module: {
15+
rules: [
16+
{
17+
test: /\.wasm$/,
18+
type: "webassembly/async",
19+
},
1920
],
20-
mode: process.env.NODE_ENV || 'development',
21-
experiments: {
22-
asyncWebAssembly: true
23-
},
24-
module: {
25-
rules: [
26-
{
27-
test: /\.wasm$/,
28-
type: 'webassembly/async'
29-
}
30-
]
31-
},
32-
resolve: {
33-
extensions: ['.js', '.wasm']
34-
}
21+
},
22+
plugins: [
23+
new HtmlWebpackPlugin({
24+
template: "./index.html", // Change this if your HTML entry is elsewhere
25+
}),
26+
new WasmPackPlugin({
27+
crateDirectory: __dirname,
28+
extraArgs: "--target bundler",
29+
}),
30+
],
31+
resolve: {
32+
extensions: [".js", ".wasm"],
33+
},
34+
devServer: {
35+
static: "./dist",
36+
hot: true,
37+
},
3538
};

0 commit comments

Comments
 (0)