wp-epub-gen 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @author oldj
3
+ * @blog http://oldj.net
4
+ */
5
+
6
+ 'use strict'
7
+
8
+ const path = require('path')
9
+ const webpack = require('webpack')
10
+ const WebpackNotifierPlugin = require('webpack-notifier')
11
+ //const CopyWebpackPlugin = require('copy-webpack-plugin')
12
+ //const TerserPlugin = require('terser-webpack-plugin')
13
+ const basedir = __dirname
14
+
15
+ module.exports = {
16
+ mode: process.env.ENV === 'dev' ? 'development' : 'production',
17
+ entry: {
18
+ index: ['./src/index.ts']
19
+ },
20
+ devtool: 'source-map',
21
+ output: {
22
+ filename: '[name].js',
23
+ path: path.join(basedir, 'dist')
24
+ },
25
+ target: 'node',
26
+ resolve: {
27
+ modules: ['node_modules', 'src'],
28
+ alias: {
29
+ '@': path.join(basedir, 'src')
30
+ },
31
+ extensions: ['.ts', '.js', '.d.ts']
32
+ },
33
+ watchOptions: {
34
+ ignored: []
35
+ },
36
+ module: {
37
+ rules: [
38
+ {
39
+ test: /\.ts$/,
40
+ loader: 'ts-loader'
41
+ }
42
+ ]
43
+ },
44
+ optimization: {
45
+ minimize: true,
46
+ minimizer: [
47
+ //new TerserPlugin({
48
+ // terserOptions: {
49
+ // output: {
50
+ // ecma: 6,
51
+ // comments: false,
52
+ // ascii_only: true
53
+ // }
54
+ // },
55
+ // parallel: true,
56
+ // cache: true,
57
+ // sourceMap: true
58
+ //})
59
+ ]
60
+ },
61
+ plugins: [
62
+ new webpack.DefinePlugin({
63
+ 'process.env': {
64
+ NODE_ENV: JSON.stringify('production')
65
+ }
66
+ }),
67
+ new webpack.IgnorePlugin(new RegExp('^(fs|path|window)$')),
68
+ new WebpackNotifierPlugin({
69
+ title: 'epub-gen',
70
+ alwaysNotify: true,
71
+ excludeWarnings: true
72
+ })
73
+ //new webpack.BannerPlugin(`WonderPen ${s_version}, ${moment().format('YYYY-MM-DD HH:mm:ss')}`)
74
+ ]
75
+ }