-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.prod.js
51 lines (49 loc) · 983 Bytes
/
webpack.config.prod.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
49
50
51
/* eslint-disable */
const path = require('path');
const dist = path.join(__dirname, 'dist');
const src = path.join(__dirname, 'src');
module.exports ={
stats: 'minimal',
context: src,
entry: './index.ts',
output: {
path: dist,
filename: 'bundle.js',
libraryTarget: 'commonjs2',
},
externals: {
react: {
commonjs: 'react',
commonjs2: 'react',
amd: 'react',
root: 'React',
},
'tiny-trans': {
commonjs: 'tiny-trans',
commonjs2: 'tiny-trans',
amd: 'tiny-trans',
root: 'Trans',
}
},
devtool: 'source-map',
resolve: {
modules: [src, 'node_modules'],
extensions: ['.tsx', '.ts', '.js'],
},
module: {
rules: [
{
test: /\.tsx?$/,
use: ['ts-loader'],
include: src,
exclude: /node_modules/,
},
{
test: /\.js$/,
exclude: /(node_modules)/,
use: ['babel-loader'],
include: src,
},
],
},
};