aboutsummaryrefslogblamecommitdiffhomepage
path: root/webpack.config.js
blob: a39832fb77341303be019c9c88d470cdcafa2877 (plain) (tree)
1
2
3
4
5
6
7
8





                                 

                                            







                                                 



                                                                             











                                                  
'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;