aboutsummaryrefslogtreecommitdiffstats
path: root/client/webpack.config.js
blob: 7384a0bd6ab5f542e01e2d5ae466668d5989a216 (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
40
41
42
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const package = require('./package.json');

module.exports = {
  entry: './src/index.js',
  module: {
    rules: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: package.babel,
        },
      },
    ],
  },
  mode: 'development',
  devtool: 'eval-source-map',
  devServer: {
    contentBase: './dist',
  },
  plugins: [
	  new webpack.EnvironmentPlugin({
		  DEBUG: false,
		  PUBLIC_URL: null,
		  API_PREFIX: null,
		  CORS_PREFIX: null,
	  }),
    new HtmlWebpackPlugin({
      title: 'FediDag'
    }),
    new CopyWebpackPlugin({ patterns: [ 'lib/*' ] }),
  ],
  output: {
    filename: '[name].bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
}