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
|
|
|
},
|
|
|
|
plugins: [
|
2020-06-01 11:53:12 +02:00
|
|
|
new HtmlWebpackPlugin(
|
|
|
|
{
|
|
|
|
template: './dist/index.html'
|
|
|
|
}
|
|
|
|
),
|
2020-04-03 14:56:21 +02:00
|
|
|
new webpack.ProvidePlugin({
|
|
|
|
Phaser: 'phaser'
|
2020-04-03 18:31:11 +02:00
|
|
|
}),
|
2020-04-13 19:40:10 +02:00
|
|
|
new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE'])
|
2020-07-28 11:06:08 +02:00
|
|
|
],
|
|
|
|
|
2020-04-03 14:56:21 +02:00
|
|
|
};
|