-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
37 lines (34 loc) · 989 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var BabiliPlugin = require('babili-webpack-plugin');
var pkg = require('./package.json');
var banner =
`OBS WebSocket Javascript API (${pkg.name}) v${pkg.version}\n` +
`Author: ${pkg.author}\n` +
`License: ${pkg.license}\n` +
`Repository: ${pkg.repoUrl}\n` +
`Build Timestamp: ${pkg.timestamp || new Date().toISOString()}`;
banner += pkg.sha ? `\nBuilt from Commit: ${pkg.repoUrl}/commit/${pkg.sha}` : ``;
module.exports = {
target: 'web',
stats: 'detailed',
mode: 'none',
entry: {
'sammi-websocket': './lib/SAMMIWebSocket.js',
'sammi-websocket.min': './lib/SAMMIWebSocket.js'
},
output: {
path: path.join(__dirname, '/dist'),
filename: '[name].js',
library: 'SAMMIWebSocket',
libraryTarget: 'umd'
},
//devtool: 'source-map',
plugins: [
new BabiliPlugin({}, {
test: /\.min\.js($|\?)/i,
comments: false
}),
new webpack.BannerPlugin({banner})
]
};