-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathwebpack4.config.js
43 lines (39 loc) · 1013 Bytes
/
webpack4.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
const webpack = require('webpack');
const path = require('path');
const packageJson = require('./package');
const isProd = process.env.NODE_ENV === 'production';
const baseFileName = 'bitmovin';
const config = {
mode: isProd ? 'production' : 'development',
context: path.join(__dirname, 'bitmovin'),
entry: ['./index.ts'],
output: {
filename: `${baseFileName}.browser${isProd ? '.min' : ''}.js`,
path: path.join(__dirname, 'dist'),
libraryTarget: 'umd',
library: 'bitmovin'
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader',
exclude: /node_modules/
}
]
},
optimization: {
noEmitOnErrors: false
},
resolve: {
extensions: ['.tsx', '.ts', '.js']
},
devtool: isProd ? false : 'source-map',
stats: process.env.WEBPACK_MODE === 'log' ? 'verbose' : 'normal',
plugins: [
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(packageJson.version)
})
]
};
module.exports = config;