-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.ts
33 lines (31 loc) · 902 Bytes
/
webpack.config.ts
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
import path from 'path'
import * as webpack from 'webpack'
import LicensePack from 'license-info-webpack-plugin'
const webpackConfig: webpack.Configuration = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
devtool: process.env.NODE_ENV !== 'production' ? 'inline-source-map' : undefined,
entry: path.join(__dirname, 'src', 'index.ts'),
output: {
path: path.join(__dirname),
filename: './dist/index.js',
library: 'KyushuHaikunator',
libraryTarget: 'umd',
globalObject: 'this'
},
resolve: {
extensions: ['.ts', '.js'],
},
plugins: [
...process.env.NODE_ENV === 'production' ? [ new LicensePack({ glob: '{LICENSE,license,License}*' }) ] : []
],
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: { loader: 'babel-loader' },
},
],
},
}
export default webpackConfig