]>
Commit | Line | Data |
---|---|---|
c194f84c | 1 | 'use strict'; |
2 | ||
3 | var path = require('path'); | |
4 | ||
5 | var webpack = require('webpack'); | |
6 | ||
0e1221d7 | 7 | var packageJson = require('./package.json'); |
8 | ||
c194f84c | 9 | var noErrorsPlugin = webpack.NoErrorsPlugin; |
10 | ||
11 | var dedupePlugin = webpack.optimize.DedupePlugin; | |
12 | ||
13 | var config | |
14 | = { cache: true | |
15 | , target: 'node' | |
16 | , entry: { index: './entry' } | |
0e1221d7 | 17 | , externals: Object.keys(packageJson.dependencies).reduce(function(b, a){ |
18 | b[a] = 'commonjs ' + a; | |
19 | return b; | |
20 | }, {}) | |
c194f84c | 21 | , output: { path: __dirname |
22 | , filename: '[name].js' | |
23 | , libraryTarget: 'commonjs2' | |
24 | } | |
25 | , plugins: [ new noErrorsPlugin() | |
26 | , new dedupePlugin() | |
27 | ] | |
28 | , resolve: { modulesDirectories: [ 'build' ] } | |
29 | } | |
30 | ; | |
31 | ||
32 | module.exports = config; |