-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathwebpack.common.js
45 lines (37 loc) · 1.08 KB
/
webpack.common.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
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const videoPlayerConfig = {
entry: {player: './src/vast-player.mjs'},
output: {
path: `${__dirname}/dist`,
filename: '[name].js',
chunkFilename: "[name].bundle.js",
},
target: 'web',
module: {
rules: [
{ test: /\.js?$/, exclude: /node_modules/, loader: 'babel-loader' },
],
},
resolve: {
modules: ['src', 'node_modules'],
extensions: ['.js', '.mjs'],
},
};
const standalonePluginConfig = Object.assign({}, videoPlayerConfig, {
entry: {
'videojsx.vast': ['./src/vast-plugin.mjs', './src/vast-player.css']
},
externals: {
'video.js': 'videojs'
},
module: {
rules: [
{ test: /\.js?$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.css?$/, exclude: /node_modules/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
],
},
plugins: [
new MiniCssExtractPlugin()
],
});
module.exports = [videoPlayerConfig, standalonePluginConfig];