webpack.config.js 816 B

123456789101112131415161718192021222324252627282930313233
  1. const dist_path = '/code/src';
  2. module.exports = {
  3. context: '/code',
  4. entry: './src/visualize.js',
  5. output: {path: dist_path, filename: 'bundle.js'},
  6. devServer: {
  7. contentBase: dist_path,
  8. // We use Docker for host restriction (see develop.sh's -p argument to
  9. // the `docker run` invocation). Due to how Docker munges host names, this
  10. // can't be restricted to localhost.
  11. host: '0.0.0.0',
  12. port: 9000,
  13. },
  14. module: {
  15. loaders: [{
  16. // Uses some new-style (ECMA 2015) classes ... compile them out.
  17. test: /\.jsx?$/,
  18. exclude: /node_modules/,
  19. loader: 'babel-loader',
  20. query: {
  21. presets: ['es2015'],
  22. plugins: [
  23. 'transform-object-rest-spread',
  24. ['transform-react-jsx', {'pragma': 'preact.h'}],
  25. ],
  26. }
  27. }]
  28. }
  29. };