js bindings

This commit is contained in:
Robin Appelman 2022-10-23 17:01:34 +02:00
commit beb9bf3aa2
18 changed files with 7985 additions and 6186 deletions

38
webpack.config.js Normal file
View file

@ -0,0 +1,38 @@
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
const dist = path.resolve(__dirname, "dist");
module.exports = {
target: 'webworker',
mode: "production",
entry: {
index: "./js/index.ts"
},
output: {
path: dist,
filename: "[name].js",
libraryTarget: 'commonjs'
},
devServer: {
contentBase: dist,
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules|pkg/,
},
],
},
plugins: [
new WasmPackPlugin({
crateDirectory: __dirname,
}),
]
};