@@ -2,7 +2,7 @@ import * as path from 'path';
2
2
import * as Webpack from 'webpack' ;
3
3
4
4
import HtmlWebpackPlugin from 'html-webpack-plugin' ;
5
- import GoogleFontsPlugin from 'google-fonts-plugin' ;
5
+ import GoogleFontsPlugin from '@beyonk/ google-fonts-webpack -plugin' ;
6
6
import CopyPlugin from 'copy-webpack-plugin' ;
7
7
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin' ;
8
8
import ForkTsCheckerNotifierWebpackPlugin from 'fork-ts-checker-notifier-webpack-plugin' ;
@@ -19,15 +19,33 @@ export default <Webpack.Configuration>{
19
19
20
20
output : {
21
21
path : OUTPUT_DIR ,
22
- filename : 'app .js' ,
22
+ filename : '[name] .js' ,
23
23
chunkFilename : '[name].bundle.js' ,
24
- // https://github.com/webpack-contrib/worker-loader/issues/142
25
- // Stops HMR breaking worker-loader
26
- globalObject : 'this'
24
+ clean : true
27
25
} ,
28
26
29
27
resolve : {
30
- extensions : [ '.mjs' , '.js' , '.ts' , '.tsx' , '.json' ]
28
+ extensions : [ '.mjs' , '.ts' , '.tsx' , '...' ] ,
29
+ fallback : {
30
+ fs : false ,
31
+ net : false ,
32
+ tls : false ,
33
+ http : false ,
34
+
35
+ assert : require . resolve ( 'assert/' ) ,
36
+ crypto : require . resolve ( 'crypto-browserify' ) ,
37
+ path : require . resolve ( 'path-browserify' ) ,
38
+ process : require . resolve ( 'process/browser' ) ,
39
+ querystring : require . resolve ( 'querystring-es3' ) ,
40
+ stream : require . resolve ( 'stream-browserify' ) ,
41
+ buffer : require . resolve ( 'buffer/' ) ,
42
+ url : require . resolve ( 'url/' ) ,
43
+ util : require . resolve ( 'util/' ) ,
44
+ zlib : require . resolve ( 'browserify-zlib' )
45
+ } ,
46
+ alias : {
47
+ mockrtc$ : path . resolve ( __dirname , '../node_modules/mockrtc/dist/main-browser.js' )
48
+ }
31
49
} ,
32
50
33
51
stats : {
@@ -46,7 +64,6 @@ export default <Webpack.Configuration>{
46
64
rules : [ {
47
65
test : / \. t s x ? $ / ,
48
66
use : [
49
- { loader : 'cache-loader' } ,
50
67
{
51
68
loader : 'thread-loader' ,
52
69
options : {
@@ -69,8 +86,8 @@ export default <Webpack.Configuration>{
69
86
] ,
70
87
exclude : / n o d e _ m o d u l e s /
71
88
} , {
72
- test : / \. ( w o f f 2 | t t f | p n g | s v g ) $ / ,
73
- loader : 'file-loader '
89
+ test : / \. ( p n g | s v g ) $ / ,
90
+ type : 'asset/resource '
74
91
} , {
75
92
test : / \. m j s $ / ,
76
93
include : / n o d e _ m o d u l e s / ,
@@ -80,18 +97,15 @@ export default <Webpack.Configuration>{
80
97
use : [ 'style-loader' , 'css-loader' ]
81
98
} , {
82
99
test : / a m i u s i n g .h t m l $ / ,
83
- use : 'raw-loader '
100
+ type : 'asset/source '
84
101
} , {
85
102
test : / n o d e _ m o d u l e s [ \\ | / ] t y p e s a f e - g e t / ,
86
103
use : { loader : 'umd-compat-loader' }
87
104
} ]
88
105
} ,
89
106
90
- node : {
91
- process : true ,
92
- fs : 'empty' ,
93
- net : 'empty' ,
94
- tls : 'empty'
107
+ experiments : {
108
+ asyncWebAssembly : true
95
109
} ,
96
110
97
111
plugins : [
@@ -106,18 +120,21 @@ export default <Webpack.Configuration>{
106
120
}
107
121
} ) ,
108
122
new ForkTsCheckerNotifierWebpackPlugin ( ) ,
109
- new Webpack . IgnorePlugin (
123
+ new Webpack . IgnorePlugin ( {
110
124
// Fallback, only used in wasm isn't supported. We just don't support zstd
111
125
// if wasm isn't supported (i.e. if loaded custom in old old browsers).
112
- / \/ z s t d - c o d e c - b i n d i n g .j s $ / , / z s t d - c o d e c /
113
- ) ,
126
+ resourceRegExp : / \/ z s t d - c o d e c - b i n d i n g .j s $ / ,
127
+ contextRegExp : / z s t d - c o d e c /
128
+ } ) ,
114
129
new HtmlWebpackPlugin ( {
115
130
template : path . join ( SRC_DIR , 'index.html' )
116
131
} ) ,
117
- new CopyPlugin ( [
118
- { from : 'node_modules/openapi-directory/api' , to : 'api' } ,
119
- { from : './extra-apis' , to : 'api' } ,
120
- ] ) ,
132
+ new CopyPlugin ( {
133
+ patterns : [
134
+ { from : 'node_modules/openapi-directory/api' , to : 'api' } ,
135
+ { from : './extra-apis' , to : 'api' } ,
136
+ ]
137
+ } ) ,
121
138
new MonacoWebpackPlugin ( {
122
139
languages : [
123
140
'html' ,
@@ -153,7 +170,12 @@ export default <Webpack.Configuration>{
153
170
{ family : "Lato" }
154
171
] ,
155
172
formats : [ 'woff2' ] , // Supported by Chrome, FF, Edge, Safari 12+
156
- filename : 'fonts.css'
173
+ filename : 'fonts.css' ,
174
+ apiUrl : 'https://gwfh.mranftl.com/api/fonts'
175
+ } ) ,
176
+ new Webpack . ProvidePlugin ( {
177
+ 'process' : 'process/browser.js' ,
178
+ 'Buffer' : [ 'buffer' , 'Buffer' ]
157
179
} ) ,
158
180
new Webpack . EnvironmentPlugin ( {
159
181
'SENTRY_DSN' : null ,
0 commit comments