webpack.config.js 816 Bytes
Newer Older
Ivan Bogatyy's avatar
Ivan Bogatyy committed
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

const dist_path = '/code/src';

module.exports = {
  context: '/code',
  entry: './src/visualize.js',
  output: {path: dist_path, filename: 'bundle.js'},
  devServer: {
    contentBase: dist_path,
    // We use Docker for host restriction (see develop.sh's -p argument to
    // the `docker run` invocation). Due to how Docker munges host names, this
    // can't be restricted to localhost.
    host: '0.0.0.0',
    port: 9000,
  },
  module: {
    loaders: [{
      // Uses some new-style (ECMA 2015) classes ... compile them out.
      test: /\.jsx?$/,
      exclude: /node_modules/,
      loader: 'babel-loader',
      query: {
        presets: ['es2015'],
        plugins: [
          'transform-object-rest-spread',
          ['transform-react-jsx', {'pragma': 'preact.h'}],
        ],
      }
    }]
  }
};