-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathwebpack.esmodule.js
64 lines (62 loc) · 1.29 KB
/
webpack.esmodule.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright Epic Games, Inc. All Rights Reserved.
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'development',
devtool: 'inline-source-map',
entry: './src/player.ts',
plugins: [
new HtmlWebpackPlugin({
title: `Pixel Streaming ES Module`,
scriptLoading: 'module',
template: `./src/player.html`,
filename: `player_esm.html`
}),
],
output: {
filename: 'player.esm.js',
libraryTarget: 'module',
module: true,
path: process.env.WEBPACK_OUTPUT_PATH ? path.resolve(process.env.WEBPACK_OUTPUT_PATH) : path.resolve(__dirname, '../../../SignallingWebServer/www'),
globalObject: 'this',
hashFunction: 'xxhash64'
},
experiments: {
outputModule: true,
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [
/node_modules/,
],
options: {
configFile: "tsconfig.esm.json"
}
},
{
test: /\.html$/i,
use: 'html-loader'
},
{
test: /\.css$/,
type: 'asset/resource',
generator: {
filename: 'css/[name][ext]'
}
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
generator: {
filename: 'images/[name][ext]'
}
}
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js', '.svg', '.json'],
},
};