aboutsummaryrefslogtreecommitdiffhomepage
path: root/webpack.config.js
blob: a39832fb77341303be019c9c88d470cdcafa2877 (plain) (blame)
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
'use strict';

var path = require('path');

var webpack = require('webpack');

var packageJson = require('./package.json');

var noErrorsPlugin = webpack.NoErrorsPlugin;

var dedupePlugin = webpack.optimize.DedupePlugin;

var config
  = { cache: true
    , target: 'node'
    , entry: { index: './entry' }
    , externals: Object.keys(packageJson.dependencies).reduce(function(b, a){
                   b[a] = 'commonjs ' + a;
                   return b;
                 }, {})
    , output: { path: __dirname
              , filename: '[name].js'
              , libraryTarget: 'commonjs2'
              }
    , plugins: [ new noErrorsPlugin()
               , new dedupePlugin()
               ]
    , resolve: { modulesDirectories: [ 'build' ] }
    }
    ;

module.exports = config;