forked from kaltura/kaltura-player-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ott.js
51 lines (44 loc) · 1.44 KB
/
webpack.config.ott.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
'use strict';
const webpack = require('webpack');
const path = require('path');
const packageData = require('./package.json');
const CopyPlugin = require('copy-webpack-plugin');
const webpackConfig = require('./webpack.config');
const PROD = process.env.NODE_ENV === 'production';
const playerType = 'ott';
const configDocsUrl = 'https://github.com/kaltura/kaltura-player-js/blob/master/docs/configuration.md';
const plugins = [
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(packageData.version),
__NAME__: JSON.stringify(packageData.name),
__PACKAGE_URL__: JSON.stringify(packageData.repository.url),
__PLAYER_TYPE__: JSON.stringify(playerType),
__CONFIG_DOCS_URL__: JSON.stringify(configDocsUrl)
})
];
if (PROD) {
plugins.push(new webpack.optimize.UglifyJsPlugin({sourceMap: true}));
} else {
plugins.push(
new CopyPlugin([
{
from: '../samples/style.css',
to: '.'
}
])
);
}
const entry = {
'kaltura-tv-player': 'index.js'
};
const alias = {
'playkit-js-providers': path.resolve('./node_modules/playkit-js-providers/dist/playkit-ott-provider'),
'playkit-js-analytics': path.resolve('./src/ott/analytics'),
'player-defaults': path.resolve('./src/ott/player-defaults'),
poster: path.resolve('./src/ott/poster')
};
// TODO: Webpack merge?
Object.assign(webpackConfig.resolve.alias, alias);
webpackConfig.entry = entry;
webpackConfig.plugins = plugins;
module.exports = webpackConfig;