-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.production.config.js
44 lines (42 loc) · 1.08 KB
/
webpack.production.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
44
/* eslint-env node */
const path = require('path');
const webpack = require('webpack');
const PACKAGE = require('./package.json');
const banner = `${PACKAGE.name} - ${PACKAGE.version} | (c) 2019 ${PACKAGE.author} | ${PACKAGE.license} | ${PACKAGE.homepage}`;
module.exports = {
mode: 'production',
target: 'web',
node: {
fs: 'empty'
},
entry: './src/mbDownloader.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'mbDownloader.min.js',
library: 'mbDownloader',
libraryTarget: 'umd',
umdNamedDefine: true
},
resolve: {
extensions: ['.js', '.ejs']
},
module: {
rules: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src')
],
use: 'babel-loader'
}
]
},
plugins: [
new webpack.BannerPlugin(banner),
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery',
'windows.jQuery': 'jquery',
}),
]
};