Merge branch 'master' of github.com:thecodingmachine/workadventure into landingpage
[libreadventure.git] / front / webpack.config.js
CommitLineData
26b8412f
DN
1const path = require('path');
2const webpack = require('webpack');
244f8719 3const HtmlWebpackPlugin = require('html-webpack-plugin');
26b8412f
DN
4
5module.exports = {
6 entry: './src/index.ts',
7 devtool: 'inline-source-map',
8 devServer: {
9 contentBase: './dist',
f1ab9705
DN
10 host: '0.0.0.0',
11 disableHostCheck: true,
daa55973
DN
12 historyApiFallback: {
13 rewrites: [
14 { from: /^_\/.*$/, to: '/index.html' }
15 ],
16 disableDotRule: true
17 },
26b8412f
DN
18 },
19 module: {
20 rules: [
21 {
22 test: /\.tsx?$/,
23 use: 'ts-loader',
24 exclude: /node_modules/,
25 },
26 ],
27 },
28 resolve: {
29 extensions: [ '.tsx', '.ts', '.js' ],
30 },
31 output: {
244f8719 32 filename: '[name].[contenthash].js',
26b8412f 33 path: path.resolve(__dirname, 'dist'),
daa55973 34 publicPath: '/'
26b8412f
DN
35 },
36 plugins: [
244f8719
GP
37 new HtmlWebpackPlugin(
38 {
39 template: './dist/index.html'
40 }
41 ),
26b8412f
DN
42 new webpack.ProvidePlugin({
43 Phaser: 'phaser'
f1ab9705 44 }),
33c58874 45 new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE'])
26b8412f
DN
46 ]
47};