-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.config.js
48 lines (44 loc) · 1.28 KB
/
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
43
44
45
46
47
48
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
const path = require('path');
const webpack = require('webpack');
const packageJson = require('./package.json');
const fs = require('fs');
const version = packageJson.version;
console.log(`Package version: ${version}`);
module.exports = {
entry: {
main: path.resolve(__dirname, 'src/index.ts'),
},
output: {
library: 'KVSWebRTC',
libraryTarget: 'window',
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
loaders: [
{
loader: 'ts-loader',
options: {
// disable type checker - we will use it in fork plugin
transpileOnly: true,
},
},
],
},
],
},
plugins: [
new ForkTsCheckerWebpackPlugin(),
new webpack.EnvironmentPlugin({
PACKAGE_VERSION: version,
}),
],
// Fail if there are any errors (such as a TypeScript type issue)
bail: true,
};