Enabling Typescript strict mode on the front
[libreadventure.git] / front / webpack.config.js
1 const path = require('path');
2 const webpack = require('webpack');
3 const HtmlWebpackPlugin = require('html-webpack-plugin');
4
5 module.exports = {
6 entry: './src/index.ts',
7 devtool: 'inline-source-map',
8 devServer: {
9 contentBase: './dist',
10 host: '0.0.0.0',
11 disableHostCheck: true,
12 historyApiFallback: {
13 rewrites: [
14 { from: /^_\/.*$/, to: '/index.html' }
15 ],
16 disableDotRule: true
17 },
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: {
32 filename: '[name].[contenthash].js',
33 path: path.resolve(__dirname, 'dist'),
34 publicPath: '/'
35 },
36 plugins: [
37 new HtmlWebpackPlugin(
38 {
39 template: './dist/index.html'
40 }
41 ),
42 new webpack.ProvidePlugin({
43 Phaser: 'phaser'
44 }),
45 new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE'])
46 ]
47 };