-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.config.js
More file actions
72 lines (58 loc) · 1.81 KB
/
Copy pathwebpack.config.js
File metadata and controls
72 lines (58 loc) · 1.81 KB
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
68
69
70
71
const path = require('path');
const webpack = require('webpack');
const glob = require('glob');
const pkg = require('./package.json');
function newConfig() {
return {
resolve: {
extensions: ['.js', '.ts', '.tsx']
},
module: {
rules: [
{test: /\.tsx?$/, loader: 'ts-loader'},
{test: /\.tsx?$/, loader: 'tslint-loader', enforce: 'pre'},
{test: /\.js$/, loader: 'source-map-loader', enforce: 'pre'},
// Disable AMD.
{test: require.resolve('error-stack-parser'), use: 'imports-loader?define=>false'},
{test: require.resolve('stackframe'), use: 'imports-loader?define=>false'},
]
},
devtool: 'nosources-source-map',
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'umd'
},
node: {
process: false
},
plugins: [
new webpack.DefinePlugin({
VERSION: JSON.stringify(pkg.version)
}),
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
sourceMap: true
}),
new webpack.BannerPlugin({banner: 'faultline-js v' + pkg.version}),
]
}
};
var client = newConfig();
var clientFiles = ['./src/airbrake-js/src/internal/compat.ts', './src/client.ts'];
client.entry = {
'client': clientFiles,
'client.min': clientFiles
};
client.output.library = ['faultlineJs', 'Client'];
// var express = newConfig();
// express.entry = {
// 'instrumentation/express': './src/airbrake-js/src/instrumentation/express.ts'
// };
// express.output.library = ['faultlineJs', 'instrumentation', 'express'];
// var hapi = newConfig();
// hapi.entry = {
// 'instrumentation/hapi': './src/airbrake-js/src/instrumentation/hapi.ts'
// };
// express.output.library = ['faultlineJs', 'instrumentation', 'hapi'];
module.exports = [client];