-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
69 lines (68 loc) · 1.57 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
57
58
59
60
61
62
63
64
65
66
67
68
69
module.exports = {
mode: "development",
watch: false, //true
externals: {
'react': 'react',
'react-dom': 'react-dom',
'react-redux': 'react-redux',
'redux': 'redux',
'@mui/material': '@mui/material',
'@mui/styles': '@mui/styles',
'@emotion/react': '@emotion/react',
'@emotion/styled': '@emotion/styled'
},
entry: {
bundle: "./src/index.ts"
},
output: {
filename: "[name].js",
path: __dirname + "/dist",
publicPath: '',
library: 'PSE',
libraryTarget: 'umd'
},
resolve: {
alias: {
"react/jsx-dev-runtime": "react/jsx-dev-runtime.js",
"react/jsx-runtime": "react/jsx-runtime.js",
},
extensions: [".ts", ".tsx", ".js", ".json"]
},
devtool: "source-map",
module: {
rules: [
{
resourceQuery: /raw/,
type: 'asset/source',
},
{
resourceQuery: /inline/,
type: 'asset/inline',
},
{
test: /\.svg(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
// css-loader is messing up SVGs: https://github.com/webpack/webpack/issues/13835
// Pin css-loader and always load them as file-resource.
type: 'asset/inline',
},
{ test: /\.scss$/, use: [
"style-loader",
"css-loader",
"sass-loader"
] },
{ test: /\.tsx?$/, loader: "babel-loader" },
{ test: /\.tsx?$/, loader: "ts-loader" },
{
test: /\.(png|jpg)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: true,
},
},
],
}
]
}
};