-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathwebpack.config.js
42 lines (39 loc) · 1.08 KB
/
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
39
40
41
42
// webpack.config.js
const path = require('path');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
mode: 'production',
devtool: false,
entry: './index.js',
target: ['web'],
output: {
path: path.resolve(__dirname, './dist'),
filename: 'facerecognition-sdk.js',
// globalObject: 'this',
library: {
type: 'umd'
}
},
plugins: [
new CleanWebpackPlugin(),
// new webpack.SourceMapDevToolPlugin({
// filename: 'facerecognition-sdk.js.map'
// }),
new CopyPlugin({
// Use copy plugin to copy *.wasm to output folder.
patterns: [{ from: 'node_modules/onnxruntime-web/dist/*.wasm', to: '[name][ext]' }]
})
],
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
use: "babel-loader",
},
],
},
}