This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathwebpack.config.js
56 lines (55 loc) · 1.93 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
53
54
55
56
const path = require('path');
module.exports = {
mode: "production",
devtool: "inline-source-map",
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js',
library: {
name:"@cheapreats/react-ui",
type: 'umd',
},
},
resolve: {
alias: {
'@Layouts/*': path.resolve(__dirname, 'src/Layouts/*'),
'@Layouts': path.resolve(__dirname, 'src/Layouts/'),
"@Containers/*": path.resolve(__dirname, 'src/Containers/*'),
"@Containers": path.resolve(__dirname, 'src/Containers/'),
"@Overview/*": path.resolve(__dirname, 'src/Overview/*'),
"@Overview": path.resolve(__dirname, 'src/Overview/'),
"@Inputs/*": path.resolve(__dirname, 'src/Inputs/*'),
"@Inputs": path.resolve(__dirname, 'src/Inputs/'),
"@Text/*": path.resolve(__dirname, 'src/Text/*'),
"@Text": path.resolve(__dirname, 'src/Text/'),
"@Themes/*": path.resolve(__dirname, 'src/Themes/*'),
"@Themes": path.resolve(__dirname, 'src/Themes/'),
"@Utils/*": path.resolve(__dirname, 'src/Utils/*'),
"@Utils": path.resolve(__dirname, 'src/Utils/')
},
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: [".tsx", ".ts", ".js"]
},
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
},
{
loader: 'ts-loader'
}
]
}
]
}
};