-
Notifications
You must be signed in to change notification settings - Fork 12
/
webpack.config.js
executable file
·92 lines (89 loc) · 2.06 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
var path = require('path');
var webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
var pathToPhaser = path.join(__dirname, '/node_modules/phaser/');
// var pathToLux = path.join(__dirname, "/node_modules/@lux-ai/2021-challenge");
var phaser = path.join(pathToPhaser, 'dist/phaser.js');
// var lux = path.join(pathToLux, "dist/lux.js");
module.exports = {
// entry: "./src/main.ts",
mode: 'none',
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
},
entry: {
app: path.join(__dirname, 'src', 'index.tsx'),
phaser: phaser,
// bundle: path.join(__dirname, 'src', 'game', 'index.ts'),
},
target: 'web',
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: '/node_modules/',
},
{
test: /\.(tsx)$/,
use: 'ts-loader',
exclude: '/node_modules/',
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
{
loader: 'url-loader',
// options: {
// name: 'images/[hash]-[name].[ext]',
// },
},
],
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
// { test: /lux\.js$/, loader: "expose-loader?Lux" }
],
},
devServer: {
contentBase: path.resolve(__dirname, './'),
publicPath: '/dist/',
host: 'localhost',
port: 3000,
open: true,
watchContentBase: true,
},
resolve: {
extensions: ['.ts', '.js', '.tsx'],
alias: {
phaser: phaser,
// lux: lux,
},
},
node: {
child_process: 'empty',
tls: 'empty',
net: 'empty',
fs: 'empty',
dns: 'empty',
'@firebase/app': 'empty',
},
optimization: {
splitChunks: {
chunks: 'all',
},
usedExports: true,
providedExports: true,
sideEffects: true,
},
mode: 'production',
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src', 'index.html'),
}),
],
};