1 | const webpack = require('webpack');
|
2 | const urls = require('./variables').urls;
|
3 |
|
4 | module.exports = {
|
5 | entry: ['./src/index.js'],
|
6 | target: 'node',
|
7 | output: {
|
8 | path: './dist',
|
9 | filename: 'seed.js',
|
10 | libraryTarget: 'umd',
|
11 | },
|
12 | module: {
|
13 | loaders: [
|
14 | {
|
15 | test: /\.js$/,
|
16 | loader: 'babel',
|
17 | exclude: /node_modules/,
|
18 | }, {
|
19 | test: /\.json$/,
|
20 | loader: 'json-loader',
|
21 | },
|
22 | ],
|
23 | },
|
24 | plugins: [
|
25 | new webpack.ProvidePlugin({
|
26 | Promise: 'es6-promise',
|
27 | fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',
|
28 | }),
|
29 | new webpack.DefinePlugin({
|
30 | COLLECTOR: JSON.stringify(urls.collector),
|
31 | }),
|
32 | new webpack.IgnorePlugin(/vertx/),
|
33 | new webpack.NormalModuleReplacementPlugin(/iconv-loader$/, 'node-noop'),
|
34 | ],
|
35 | };
|