/
webpack.config.js
44 lines (43 loc) · 1.21 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
const webpack = require('webpack');
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'production',
entry: './src/index.ts',
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.HashedModuleIdsPlugin({
hashFunction: 'sha256',
hashDigest: 'hex',
hashDigestLength: 20
}),
new CopyWebpackPlugin([{ from: 'package.publish.json', to: 'package.json' }])
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
library: 'browser-logger',
libraryTarget: 'umd',
chunkFilename: '[id].[chunkhash].js'
},
externals: {
dexie: {
commonjs: 'dexie',
commonjs2: 'dexie',
amd: 'dexie',
root: '_'
},
'json-stringify-safe': {
commonjs: '"json-stringify-safe"',
commonjs2: '"json-stringify-safe"',
amd: '"json-stringify-safe"',
root: '_'
}
},
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [{ test: /\.tsx?$/, loader: 'ts-loader' }]
}
};