-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwebpack.config.prod.js
More file actions
55 lines (52 loc) · 1.26 KB
/
webpack.config.prod.js
File metadata and controls
55 lines (52 loc) · 1.26 KB
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
49
50
51
52
53
54
55
/*********************************************************************
* Copyright (c) Intel Corporation 2020
* SPDX-License-Identifier: Apache-2.0
**********************************************************************/
const path = require('path') // No ES6 in webpack config
const webpack = require('webpack')
module.exports = {
mode: 'production',
entry: {
core: './src/core/index.ts'
},
// sourceMap in tsconfig which holds information about your original files when the code is minified
// devtool deal with existing source maps
devtool: 'inline-source-map',
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, './dist'),
library: {
name: 'ui-toolkit',
type: 'umd'
}
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'babel-loader',
options: {
plugins: [['transform-remove-console', { exclude: ['error', 'warn'] }]]
}
},
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.build.json'
}
}
],
exclude: /node_modules/
}
]
},
resolve: {
extensions: [
'.tsx',
'.ts',
'.js'
]
}
}