forked from lelinhtinh/jEpub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.production.config.js
49 lines (47 loc) · 1.23 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
45
46
47
48
49
/* eslint-env node */
const path = require('path');
const webpack = require('webpack');
const PACKAGE = require('./package.json');
const banner = `${PACKAGE.name} - ${PACKAGE.version} | (c) 2018 ${PACKAGE.author} | ${PACKAGE.license} | ${PACKAGE.homepage}`;
module.exports = {
mode: 'production',
target: 'web',
node: {
fs: 'empty'
},
entry: './src/jepub.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'jepub.min.js',
library: 'jEpub',
libraryTarget: 'umd',
umdNamedDefine: true
},
resolve: {
extensions: ['.js', '.ejs']
},
module: {
rules: [
{
test: /[^.]|\.(xml|html|css|ejs)$/,
include: [
path.resolve(__dirname, 'src/tpl')
],
use: 'raw-loader'
},
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src')
],
exclude: [
path.resolve(__dirname, 'src/tpl')
],
use: 'babel-loader'
}
]
},
plugins: [
new webpack.BannerPlugin(banner)
]
};