forked from justjake/quickjs-emscripten
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
38 lines (34 loc) · 919 Bytes
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const path = require('path');
const webpack = require('webpack')
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
entry: './ts/index.ts',
output: {
path: path.resolve(__dirname, 'dist_pack'),
filename: 'bundle.js',
library: {
name: 'chili_quickjs',
type: 'assign-properties'
}
},
resolve: {
extensions: ['.ts', '.js'],
fallback: { "path": false, "fs": false, "crypto": false }
},
plugins: [
new webpack.ProvidePlugin({
process: 'process/browser',
}),
new CopyPlugin({
patterns: [
{ from: "*.wasm", to: "", context: "dist/generated" },
],
}),
],
module: {
rules: [
{ test: /\.ts$/, loader: "ts-loader" },
{ test: /\.wasm$/, type: "asset/resource" }
]
}
};