-
Notifications
You must be signed in to change notification settings - Fork 53
/
webpack.config.js
52 lines (50 loc) · 1.23 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
49
50
51
52
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Path = require('path')
// eslint-disable-next-line import/no-anonymous-default-export
module.exports = () => {
const entry = Path.resolve(__dirname, 'src', 'App.tsx')
return {
mode: 'production',
entry,
output: {
path: Path.resolve(__dirname, 'lib'),
filename: 'App.js',
library: 'beeDashboard',
libraryTarget: 'umd',
},
resolve: {
extensions: ['.css', '.png', '.svg', '.ttf', '.ts', '.tsx', '.js'],
},
devtool: 'source-map',
externals: {
// Use external version of React
// react: 'root React',
react: 'react',
'react-dom': 'react-dom',
},
target: 'web',
optimization: {
minimize: false,
},
module: {
rules: [
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(jpe?g|png|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use: ['base64-inline-loader'],
type: 'javascript/auto'
},
{
test: /\.(ts|js|tsx|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
],
},
}
}