workadventure/front/webpack.config.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-04-03 14:56:21 +02:00
const path = require('path');
const webpack = require('webpack');
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',
host: '0.0.0.0',
disableHostCheck: true,
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: {
filename: '[name].[contenthash].js',
2020-04-03 14:56:21 +02:00
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
2020-04-03 14:56:21 +02:00
},
externals:[
require('webpack-require-http')
],
2020-04-03 14:56:21 +02:00
plugins: [
new HtmlWebpackPlugin(
{
template: './dist/index.html'
}
),
2020-04-03 14:56:21 +02:00
new webpack.ProvidePlugin({
Phaser: 'phaser'
}),
new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE', 'TURN_SERVER', 'TURN_USER', 'TURN_PASSWORD', 'JITSI_URL'])
2020-07-28 11:06:08 +02:00
],
2020-04-03 14:56:21 +02:00
};