-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
42 lines (39 loc) · 995 Bytes
/
webpack.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
const webpack = require('webpack');
const path = require('path');
const pkg = require('./package.json');
const VERSION = process.env.VERSION || pkg.version;
module.exports = {
mode: 'production',
entry: './src/index.ts',
output: {
filename: 'hawk.js',
libraryTarget: 'umd',
libraryExport: 'default',
library: 'HawkCatcher',
},
resolve: {
modules: [path.join(__dirname, 'src'), 'node_modules'],
extensions: ['.js', '.ts'],
},
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
},
],
},
],
},
plugins: [
/** Pass variables into modules */
new webpack.DefinePlugin({
VERSION: JSON.stringify(VERSION),
}),
new webpack.BannerPlugin({
banner: `Hawk JS Catcher.js\n\n@version ${VERSION}\n\n@licence Apache-2.0\n@author CodeX <https://codex.so>\n\n@see https://hawk.so\n@see https://github.com/codex-team/hawk.javascript`,
}),
],
};