daa559738b
Arriving on a new map now changes the URL. All URLs starting with _ are automatically redirected to index.html by the web server
42 lines
972 B
JavaScript
42 lines
972 B
JavaScript
const path = require('path');
|
|
const webpack = require('webpack');
|
|
|
|
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
|
|
},
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: [ '.tsx', '.ts', '.js' ],
|
|
},
|
|
output: {
|
|
filename: 'bundle.js',
|
|
path: path.resolve(__dirname, 'dist'),
|
|
publicPath: '/'
|
|
},
|
|
plugins: [
|
|
new webpack.ProvidePlugin({
|
|
Phaser: 'phaser'
|
|
}),
|
|
new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE'])
|
|
]
|
|
};
|