@@ -179,122 +179,113 @@ module.exports = {
179
179
new webpack . EnvironmentPlugin ( loadedDotenv ) ,
180
180
...( analyze
181
181
? [
182
- new BundleAnalyzerPlugin ( {
183
- analyzerMode : 'static' ,
184
- openAnalyzer : false ,
185
- } ) ,
186
- ]
182
+ new BundleAnalyzerPlugin ( {
183
+ analyzerMode : 'static' ,
184
+ openAnalyzer : false ,
185
+ } ) ,
186
+ ]
187
187
: [ ] ) ,
188
188
// Ignore all locale files of moment.js
189
189
new webpack . IgnorePlugin ( {
190
190
resourceRegExp : / ^ \. \/ l o c a l e $ / ,
191
191
contextRegExp : / m o m e n t $ / ,
192
192
} ) ,
193
- // Fix process is not defined error
194
- new webpack . ProvidePlugin ( {
195
- process : 'process/browser' ,
196
- } ) ,
197
- // Work around for Buffer is undefined:
198
- // https://github.com/webpack/changelog-v5/issues/10
199
- new webpack . ProvidePlugin ( {
200
- Buffer : [ 'buffer' , 'Buffer' ] ,
201
- } ) ,
202
193
]
203
194
. concat (
204
195
isProduction ( )
205
196
? [
206
- new CleanWebpackPlugin ( { cleanOnceBeforeBuildPatterns : [ dist ] } ) ,
207
- // Production plugins
208
- // new webpack.optimize.OccurrenceOrderPlugin(), // commented out as it started throwing errors after update to webpack5
209
- new webpack . EnvironmentPlugin ( {
210
- NODE_ENV : 'production' ,
211
- } ) ,
212
- new OptimizeCssAssetsPlugin ( {
213
- cssProcessor,
214
- cssProcessorOptions : {
215
- discardComments : {
216
- removeAll : true ,
217
- } ,
218
- } ,
219
- canPrint : true ,
220
- } ) ,
221
- new ImageminPlugin ( {
222
- disable : ! isProduction ( ) , // Disable during development
223
- pngquant : {
224
- quality : '50-75' ,
225
- } ,
226
- } ) ,
227
- ]
197
+ new CleanWebpackPlugin ( { cleanOnceBeforeBuildPatterns : [ dist ] } ) ,
198
+ // Production plugins
199
+ // new webpack.optimize.OccurrenceOrderPlugin(), // commented out as it started throwing errors after update to webpack5
200
+ new webpack . EnvironmentPlugin ( {
201
+ NODE_ENV : 'production' ,
202
+ } ) ,
203
+ new OptimizeCssAssetsPlugin ( {
204
+ cssProcessor,
205
+ cssProcessorOptions : {
206
+ discardComments : {
207
+ removeAll : true ,
208
+ } ,
209
+ } ,
210
+ canPrint : true ,
211
+ } ) ,
212
+ new ImageminPlugin ( {
213
+ disable : ! isProduction ( ) , // Disable during development
214
+ pngquant : {
215
+ quality : '50-75' ,
216
+ } ,
217
+ } ) ,
218
+ ]
228
219
: [
229
- // Dev plugins
230
- new DeadCodePlugin ( {
231
- exclude : [
232
- '**/node_modules/**/*.*' ,
233
- 'storybook-static/**/*.*' ,
234
- 'dist/**/*.*' ,
235
- 'coverage/**/*.*' ,
236
- // skip tests
237
- '**/tests/*.*' ,
238
- '**/tests/**/*.*' ,
239
- '**/test/*.*' ,
240
- '**/test/**/*.*' ,
241
- '**/*.test.ts' ,
242
- '**/*.test.tsx' ,
243
- // skip conditional stubs
244
- '**/stub.tsx' ,
245
- // skip stories
246
- '**/*.stories.*' ,
247
- // skip sketch files
248
- '**/*.sketch' ,
249
- // other files
250
- 'package-lock.json' ,
251
- 'codegen.ts' ,
252
- 'README.md' ,
253
- 'babel.config.js' ,
254
- 'codegen.ts' ,
255
- 'cypress.config.ts' ,
256
- 'healthcheck.ts' ,
257
- 'jest.config.js' ,
258
- 'webpack.config.*' ,
259
- 'nginx.conf' ,
260
- 'src/generated/**/*.*' ,
261
- '*.json' ,
262
- 'scripts/**/*.*' ,
263
- 'cypress/**/*.*' ,
264
- 'src/queries/*.ts' ,
265
- '**/*.css' ,
266
- 'types/**/*.d.ts' ,
267
- ] ,
268
- } ) ,
269
- new WebpackNotifierPlugin ( ) ,
270
- ] ,
220
+ // Dev plugins
221
+ new DeadCodePlugin ( {
222
+ exclude : [
223
+ '**/node_modules/**/*.*' ,
224
+ 'storybook-static/**/*.*' ,
225
+ 'dist/**/*.*' ,
226
+ 'coverage/**/*.*' ,
227
+ // skip tests
228
+ '**/tests/*.*' ,
229
+ '**/tests/**/*.*' ,
230
+ '**/test/*.*' ,
231
+ '**/test/**/*.*' ,
232
+ '**/*.test.ts' ,
233
+ '**/*.test.tsx' ,
234
+ // skip conditional stubs
235
+ '**/stub.tsx' ,
236
+ // skip stories
237
+ '**/*.stories.*' ,
238
+ // skip sketch files
239
+ '**/*.sketch' ,
240
+ // other files
241
+ 'package-lock.json' ,
242
+ 'codegen.ts' ,
243
+ 'README.md' ,
244
+ 'babel.config.js' ,
245
+ 'codegen.ts' ,
246
+ 'cypress.config.ts' ,
247
+ 'healthcheck.ts' ,
248
+ 'jest.config.js' ,
249
+ 'webpack.config.*' ,
250
+ 'nginx.conf' ,
251
+ 'src/generated/**/*.*' ,
252
+ '*.json' ,
253
+ 'scripts/**/*.*' ,
254
+ 'cypress/**/*.*' ,
255
+ 'src/queries/*.ts' ,
256
+ '**/*.css' ,
257
+ 'types/**/*.d.ts' ,
258
+ ] ,
259
+ } ) ,
260
+ new WebpackNotifierPlugin ( ) ,
261
+ ] ,
271
262
)
272
263
. concat (
273
264
process . env . SENTRY_AUTH_TOKEN
274
265
? [
275
- sentryWebpackPlugin ( {
276
- include : dist ,
277
- validate : true ,
278
- org : process . env . SENTRY_ORG || 'streamr' ,
279
- project : process . env . SENTRY_PROJECT || 'hub' ,
280
- authToken : process . env . SENTRY_AUTH_TOKEN ,
281
- ignore : [
282
- '.cache' ,
283
- '.DS_STORE' ,
284
- '.env' ,
285
- '.envrc' ,
286
- '.storybook' ,
287
- 'bin' ,
288
- 'coverage' ,
289
- 'node_modules' ,
290
- 'scripts' ,
291
- 'stories' ,
292
- 'test' ,
293
- 'webpack.config.js' ,
294
- ] ,
295
- release : process . env . VERSION ,
296
- } ) ,
297
- ]
266
+ sentryWebpackPlugin ( {
267
+ include : dist ,
268
+ validate : true ,
269
+ org : process . env . SENTRY_ORG || 'streamr' ,
270
+ project : process . env . SENTRY_PROJECT || 'hub' ,
271
+ authToken : process . env . SENTRY_AUTH_TOKEN ,
272
+ ignore : [
273
+ '.cache' ,
274
+ '.DS_STORE' ,
275
+ '.env' ,
276
+ '.envrc' ,
277
+ '.storybook' ,
278
+ 'bin' ,
279
+ 'coverage' ,
280
+ 'node_modules' ,
281
+ 'scripts' ,
282
+ 'stories' ,
283
+ 'test' ,
284
+ 'webpack.config.js' ,
285
+ ] ,
286
+ release : process . env . VERSION ,
287
+ } ) ,
288
+ ]
298
289
: [ ] ,
299
290
) ,
300
291
devtool : isProduction ( ) ? 'source-map' : 'eval-source-map' ,
0 commit comments