-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
67 lines (55 loc) · 1.34 KB
/
webpack.config.js
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
61
62
63
64
65
66
67
//
// Copyright 2018 Wireline, Inc.
//
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ZipPlugin = require('zip-webpack-plugin');
module.exports = {
target: 'node',
mode: 'development',
stats: 'errors-only',
entry: {
handler: [
path.resolve('./handler.js')
]
},
output: {
path: path.resolve('./dist'),
filename: '[name].js',
libraryTarget: 'commonjs2'
},
// https://webpack.js.org/configuration/devtool/
devtool: 'source-map',
devServer: {
compress: true,
publicPath: '/assets/',
port: 8080
},
plugins: [
new CopyWebpackPlugin([
'wireline.yml'
]),
new ZipPlugin({
path: '../',
filename: 'webpack.zip'
}),
// Issue with got https://github.com/sindresorhus/got/issues/345.
new webpack.IgnorePlugin(/^electron$/),
// The pg-native bindings are not needed.
new webpack.IgnorePlugin(/\.\/native/, /\/pg\//),
// The Swagger autogenerated API clients misbehave without this due to a problem with superagent.
new webpack.DefinePlugin({ 'global.GENTLY': false })
],
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/, // Don't transpile deps.
use: {
loader: 'babel-loader',
}
}
]
}
};