summaryrefslogtreecommitdiff
path: root/web-ui/webpack.config.js
blob: e82cf88b7e6544e025d04c5fe607a9beaa9dc372 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
var path = require('path');
var webpack = require('webpack');
var publicAssetsWebpack = require('./config/public-assets-webpack');
var protectedAssetsWebpack = require('./config/protected-assets-webpack');
var loaders = require('./config/loaders-webpack');
var aliases = require('./config/alias-webpack');

var commonConfiguration = {
  node: { fs: 'empty' },
  devtool: 'source-map',
  resolve: {
    alias: aliases,
    extensions: ['', '.js']
  },
  module: {
    loaders: loaders
  },
  postcss: {}
};

var publicAssets = Object.assign({}, commonConfiguration, {
  entry: {
    'login': './src/login/login.js',
    'account_recovery': './src/account_recovery/account_recovery.js'
  },
  output: {
    path: path.join(__dirname, 'dist/public'),
    filename: '[name].js',
    publicPath: '/public/'
  },
  plugins: [
    publicAssetsWebpack,
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('development')
      }
  })]
});

var protectedAssets = Object.assign({}, commonConfiguration, {
  entry: {
    'app': './app/js/index.js',
    'backup_account': './src/backup_account/backup_account.js',
    'sandbox': './app/js/sandbox.js'
  },
  output: {
    path: path.join(__dirname, 'dist/protected'),
    filename: '[name].js',
    publicPath: '/assets/'
  },
  plugins: [
    protectedAssetsWebpack,
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('development')
      }
  })]
});

module.exports = [publicAssets, protectedAssets];