summaryrefslogtreecommitdiff
path: root/webpack.config.js
blob: b08368c7b19cd6392dda2455b19fe5dc6deb4a6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var webpack = require('webpack')
var path = require('path')

module.exports = {
  entry: './client/index.jsx',
  watch: true,
	devtool: 'cheap-source-map',
  output: {
    filename: './public/bundle.js'
  },
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['env','es2015','stage-0'],
          }
        }
      },
      {
        test: /\.css$/,
        use: [ 'style-loader', 'css-loader' ]
      },
    ]
  },
  resolve: {
    alias: {
      'react': 'preact-compat',
      'react-dom': 'preact-compat',
    }
  },
  devServer: {
    contentBase: path.join(__dirname, "public"),
    compress: true,
  }
}