2020-04-03 14:56:21 +02:00
|
|
|
const path = require('path');
|
|
|
|
const webpack = require('webpack');
|
2020-06-01 11:53:12 +02:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2020-04-03 14:56:21 +02:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './src/index.ts',
|
|
|
|
devtool: 'inline-source-map',
|
|
|
|
devServer: {
|
|
|
|
contentBase: './dist',
|
2020-04-03 18:31:11 +02:00
|
|
|
host: '0.0.0.0',
|
|
|
|
disableHostCheck: true,
|
2020-05-12 00:07:50 +02:00
|
|
|
historyApiFallback: {
|
|
|
|
rewrites: [
|
|
|
|
{ from: /^_\/.*$/, to: '/index.html' }
|
|
|
|
],
|
|
|
|
disableDotRule: true
|
|
|
|
},
|
2020-04-03 14:56:21 +02:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: [ '.tsx', '.ts', '.js' ],
|
|
|
|
},
|
|
|
|
output: {
|
2020-06-01 11:53:12 +02:00
|
|
|
filename: '[name].[contenthash].js',
|
2020-04-03 14:56:21 +02:00
|
|
|
path: path.resolve(__dirname, 'dist'),
|
2020-05-12 00:07:50 +02:00
|
|
|
publicPath: '/'
|
2020-04-03 14:56:21 +02:00
|
|
|
},
|
2020-07-23 18:09:24 +02:00
|
|
|
externals:[
|
|
|
|
require('webpack-require-http')
|
|
|
|
],
|
2020-04-03 14:56:21 +02:00
|
|
|
plugins: [
|
2020-06-01 11:53:12 +02:00
|
|
|
new HtmlWebpackPlugin(
|
|
|
|
{
|
2021-02-02 11:19:24 +01:00
|
|
|
template: './dist/index.tmpl.html',
|
|
|
|
minify: {
|
|
|
|
collapseWhitespace: true,
|
|
|
|
keepClosingSlash: true,
|
|
|
|
removeComments: false,
|
|
|
|
removeRedundantAttributes: true,
|
|
|
|
removeScriptTypeAttributes: true,
|
|
|
|
removeStyleLinkTypeAttributes: true,
|
|
|
|
useShortDoctype: true
|
|
|
|
}
|
2020-06-01 11:53:12 +02:00
|
|
|
}
|
|
|
|
),
|
2020-04-03 14:56:21 +02:00
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
Phaser: 'phaser'
|
2020-04-03 18:31:11 +02:00
|
|
|
}),
|
2021-02-08 20:46:26 +01:00
|
|
|
new webpack.EnvironmentPlugin([
|
|
|
|
'API_URL',
|
|
|
|
'UPLOADER_URL',
|
|
|
|
'ADMIN_URL',
|
|
|
|
'DEBUG_MODE',
|
|
|
|
'STUN_SERVER',
|
|
|
|
'TURN_SERVER',
|
|
|
|
'TURN_USER',
|
|
|
|
'TURN_PASSWORD',
|
|
|
|
'JITSI_URL',
|
|
|
|
'JITSI_PRIVATE_MODE',
|
|
|
|
'START_ROOM_URL'
|
|
|
|
])
|
2020-07-28 11:06:08 +02:00
|
|
|
],
|
|
|
|
|
2020-04-03 14:56:21 +02:00
|
|
|
};
|