@digest/webpack 3.3.4 → 3.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/webpack.config.js +128 -49
  2. package/package.json +11 -11
@@ -52,23 +52,30 @@ const workers = os_1.default.cpus().length - 2 < 1 ?
52
52
  os_1.default.cpus().length - 2;
53
53
  const threadLoader = {
54
54
  loader: 'thread-loader',
55
- options: { workers }
55
+ options: {
56
+ workers
57
+ }
56
58
  };
57
59
  const styleLoaders = (options = {}) => {
58
60
  options.camelCase = options.camelCase === undefined ?
59
61
  true :
60
62
  options.camelCase;
61
63
  return [].concat(scripts_1.default.production ?
62
- [{
64
+ [
65
+ {
63
66
  loader: mini_css_extract_plugin_1.default.loader,
64
67
  options: {
65
68
  publicPath: '../'
66
69
  }
67
- }] :
70
+ }
71
+ ] :
68
72
  [
69
73
  threadLoader,
70
- { loader: 'style-loader' }
71
- ], [{
74
+ {
75
+ loader: 'style-loader'
76
+ }
77
+ ], [
78
+ {
72
79
  loader: 'css-loader',
73
80
  options: {
74
81
  importLoaders: 1,
@@ -84,8 +91,10 @@ const styleLoaders = (options = {}) => {
84
91
  undefined,
85
92
  sourceMap: options.sourceMap
86
93
  }
87
- }], options.postcss ?
88
- [{
94
+ }
95
+ ], options.postcss ?
96
+ [
97
+ {
89
98
  loader: 'postcss-loader',
90
99
  options: {
91
100
  postcssOptions: {
@@ -94,21 +103,27 @@ const styleLoaders = (options = {}) => {
94
103
  },
95
104
  sourceMap: options.sourceMap
96
105
  }
97
- }] :
106
+ }
107
+ ] :
98
108
  [], options.scss ?
99
- [{
109
+ [
110
+ {
100
111
  loader: 'sass-loader',
101
112
  options: {
102
113
  sourceMap: options.sourceMap
103
114
  }
104
- }] :
115
+ }
116
+ ] :
105
117
  []);
106
118
  };
107
119
  const scriptLoaders = (options = {}) => {
108
120
  return [].concat(scripts_1.default.parallel ?
109
- [threadLoader] :
121
+ [
122
+ threadLoader
123
+ ] :
110
124
  [], scripts_1.default.webpackBabel ?
111
- [{
125
+ [
126
+ {
112
127
  loader: 'babel-loader',
113
128
  options: {
114
129
  cacheDirectory: path_1.default.join(scripts_1.default.cache, 'babel-loader'),
@@ -119,15 +134,24 @@ const scriptLoaders = (options = {}) => {
119
134
  ].filter(Boolean) :
120
135
  []
121
136
  }
122
- }] :
137
+ }
138
+ ] :
123
139
  [], options.typescript ?
124
140
  [].concat(!scripts_1.default.production && scripts_1.default.webpackAngular ?
125
141
  [
126
- { loader: 'angular2-template-loader' },
127
- { loader: '@angularclass/hmr-loader' }
142
+ {
143
+ loader: 'angular2-template-loader'
144
+ },
145
+ {
146
+ loader: '@angularclass/hmr-loader'
147
+ }
128
148
  ] :
129
149
  []) :
130
- [], [{ loader: 'source-map-loader' }]);
150
+ [], [
151
+ {
152
+ loader: 'source-map-loader'
153
+ }
154
+ ]);
131
155
  };
132
156
  const generateName = (extension, chunkName) => {
133
157
  const hash = extension === 'css' ?
@@ -174,47 +198,75 @@ const configuration = {
174
198
  require.resolve('@digest/webpack-workbox') :
175
199
  [], !scripts_1.default.library && scripts_1.default.webpackAngular ?
176
200
  angularPolyfills :
177
- [], [scripts_1.default.context])
201
+ [], [
202
+ scripts_1.default.context
203
+ ])
178
204
  },
179
205
  externals: scripts_1.default.library ?
180
- [(0, webpack_node_externals_1.default)()] :
206
+ [
207
+ (0, webpack_node_externals_1.default)()
208
+ ] :
181
209
  undefined,
182
210
  externalsPresets: scripts_1.default.library ?
183
- { node: true } :
211
+ {
212
+ node: true
213
+ } :
184
214
  undefined,
185
215
  mode: scripts_1.default.production ?
186
216
  'production' :
187
217
  'development',
188
218
  module: {
189
- rules: [].concat([{
190
- generator: { filename: `templates/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
219
+ rules: [].concat([
220
+ {
221
+ generator: {
222
+ filename: `templates/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
223
+ },
191
224
  test: /\.html$/u,
192
225
  type: 'asset/resource'
193
- }, {
194
- generator: { filename: `icons/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
226
+ },
227
+ {
228
+ generator: {
229
+ filename: `icons/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
230
+ },
195
231
  test: /\.ico$/u,
196
232
  type: 'asset/resource'
197
- }, {
198
- generator: { filename: `images/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
233
+ },
234
+ {
235
+ generator: {
236
+ filename: `images/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
237
+ },
199
238
  test: /\.(png|jpg)$/u,
200
239
  type: 'asset/resource'
201
- }, {
202
- generator: { filename: `gifs/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
240
+ },
241
+ {
242
+ generator: {
243
+ filename: `gifs/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
244
+ },
203
245
  test: /\.gif$/u,
204
246
  type: 'asset/resource'
205
- }, {
206
- generator: { filename: `svg/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
247
+ },
248
+ {
249
+ generator: {
250
+ filename: `svg/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
251
+ },
207
252
  test: /\.(svg)(\?v=\d\.\d\.\d)?$/u,
208
253
  type: 'asset/resource'
209
- }, {
210
- generator: { filename: `fonts/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
254
+ },
255
+ {
256
+ generator: {
257
+ filename: `fonts/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
258
+ },
211
259
  test: /\.woff(2)?(\?v=\d\.\d\.\d)?$/u,
212
260
  type: 'asset/resource'
213
- }, {
214
- generator: { filename: `fonts/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]` },
261
+ },
262
+ {
263
+ generator: {
264
+ filename: `fonts/[name][ext]?_=[hash:${scripts_1.default.HASH_LIMIT}]`
265
+ },
215
266
  test: /\.(ttf|eot)(\?v=\d\.\d\.\d)?$/u,
216
267
  type: 'asset/resource'
217
- }, {
268
+ },
269
+ {
218
270
  exclude: new RegExp(`\.g\.css$|\.min\.css$|node_modules\/(?!.*(${scripts_1.default.postcssWhitelist})).*\.css$`, 'u'),
219
271
  test: /\.css$/u,
220
272
  use: styleLoaders({
@@ -223,28 +275,33 @@ const configuration = {
223
275
  postcss: Boolean(scripts_1.default.webpackPostCSS),
224
276
  sourceMap: scripts_1.default.sourceMap
225
277
  })
226
- }, {
278
+ },
279
+ {
227
280
  test: /\.g\.css$/u,
228
281
  use: styleLoaders({
229
282
  minimize: scripts_1.default.minimize && scripts_1.default.production,
230
283
  postcss: Boolean(scripts_1.default.webpackPostCSS),
231
284
  sourceMap: scripts_1.default.sourceMap
232
285
  })
233
- }, {
286
+ },
287
+ {
234
288
  test: new RegExp(`\.min\.css$|node_modules\/(?!.*(${scripts_1.default.postcssWhitelist})).*\.css$`, 'u'),
235
289
  use: styleLoaders({
236
290
  camelCase: false,
237
291
  minimize: false
238
292
  })
239
- }, {
293
+ },
294
+ {
240
295
  exclude: scripts_1.default.ignore,
241
296
  test: /\.js$/u,
242
297
  use: scriptLoaders()
243
- }, {
298
+ },
299
+ {
244
300
  exclude: scripts_1.default.ignore,
245
301
  test: /\.mjs$/u,
246
302
  use: scriptLoaders()
247
- }], scripts_1.default.webpackSCSS ?
303
+ }
304
+ ], scripts_1.default.webpackSCSS ?
248
305
  [
249
306
  {
250
307
  exclude: new RegExp(`\.g\.(scss|sass)$|\.min\.(scss|sass)$|node_modules\/(?!.*(${scripts_1.default.postcssWhitelist})).*\.(scss|sass)$`, 'u'),
@@ -255,7 +312,8 @@ const configuration = {
255
312
  scss: scripts_1.default.webpackSCSS,
256
313
  sourceMap: scripts_1.default.sourceMap
257
314
  })
258
- }, {
315
+ },
316
+ {
259
317
  test: /\.g\.(scss|sass)$/u,
260
318
  use: styleLoaders({
261
319
  minimize: scripts_1.default.minimize && scripts_1.default.production,
@@ -301,7 +359,11 @@ const configuration = {
301
359
  {
302
360
  exclude: /node_modules/u,
303
361
  test: /\.(graphql|gql)$/u,
304
- use: [{ loader: 'graphql-tag/loader' }]
362
+ use: [
363
+ {
364
+ loader: 'graphql-tag/loader'
365
+ }
366
+ ]
305
367
  }
306
368
  ] :
307
369
  [])
@@ -521,7 +583,8 @@ const configuration = {
521
583
  })
522
584
  ] :
523
585
  [], scripts_1.default.webpackWorkbox && scripts_1.default.production && !scripts_1.default.library ?
524
- [new GenerateSW({
586
+ [
587
+ new GenerateSW({
525
588
  cacheId: scripts_1.default.shortName,
526
589
  clientsClaim: false,
527
590
  directoryIndex: 'index.html',
@@ -542,18 +605,29 @@ const configuration = {
542
605
  /^\/_/u,
543
606
  /\/[^/]+\\.[^/]+$/u
544
607
  ], scripts_1.default.fallbackDenyList ?
545
- [scripts_1.default.fallbackDenyList] :
608
+ [
609
+ scripts_1.default.fallbackDenyList
610
+ ] :
546
611
  []),
547
- runtimeCaching: [{
612
+ runtimeCaching: [
613
+ {
548
614
  handler: 'CacheFirst',
549
615
  urlPattern: /bundle/u
550
- }],
616
+ }
617
+ ],
551
618
  swDest: path_1.default.join('..', 'workbox.js')
552
- })] :
619
+ })
620
+ ] :
553
621
  []),
554
622
  profile: true,
555
623
  resolve: {
556
- extensions: ['.js', '.mjs', '.jsx', '.ts', '.tsx'],
624
+ extensions: [
625
+ '.js',
626
+ '.mjs',
627
+ '.jsx',
628
+ '.ts',
629
+ '.tsx'
630
+ ],
557
631
  modules: [
558
632
  path_1.default.join('node_modules'),
559
633
  path_1.default.join(process.cwd())
@@ -567,7 +641,12 @@ const configuration = {
567
641
  },
568
642
  stats: 'minimal',
569
643
  target: scripts_1.default.library ?
570
- ['node'] :
571
- ['web', 'es5']
644
+ [
645
+ 'node'
646
+ ] :
647
+ [
648
+ 'web',
649
+ 'es5'
650
+ ]
572
651
  };
573
652
  module.exports = configuration;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@digest/webpack",
3
3
  "title": "Webpack Digest",
4
4
  "license": "GPL-3.0",
5
- "version": "3.3.4",
5
+ "version": "3.3.5",
6
6
  "description": "Digested Webpack Configurations",
7
7
  "author": {
8
8
  "name": "wallzero @wallzeroblog",
@@ -40,31 +40,31 @@
40
40
  "clean": "rimraf node_modules dist package-lock.json npm-debug.log"
41
41
  },
42
42
  "dependencies": {
43
- "@digest/scripts": "^3.3.4",
43
+ "@digest/scripts": "^3.3.5",
44
44
  "@vue/preload-webpack-plugin": "^2.0.0",
45
45
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
46
46
  "circular-dependency-plugin": "^5.2.2",
47
47
  "clean-terminal-webpack-plugin": "^3.0.0",
48
48
  "clean-webpack-plugin": "^4.0.0",
49
- "compression-webpack-plugin": "^9.0.1",
49
+ "compression-webpack-plugin": "^9.2.0",
50
50
  "css-loader": "^6.5.1",
51
- "css-minimizer-webpack-plugin": "^3.2.0",
51
+ "css-minimizer-webpack-plugin": "^3.3.1",
52
52
  "duplicate-package-checker-webpack-plugin": "^3.0.0",
53
- "html-loader": "^3.0.1",
53
+ "html-loader": "^3.1.0",
54
54
  "html-webpack-harddisk-plugin": "^2.0.0",
55
55
  "html-webpack-link-type-plugin": "^1.1.1",
56
56
  "html-webpack-plugin": "^5.5.0",
57
57
  "identity-obj-proxy": "^3.0.0",
58
58
  "ip": "^1.1.5",
59
- "mini-css-extract-plugin": "^2.4.5",
59
+ "mini-css-extract-plugin": "^2.4.6",
60
60
  "raw-loader": "^4.0.2",
61
- "source-map-loader": "^3.0.0",
61
+ "source-map-loader": "^3.0.1",
62
62
  "stats-webpack-plugin": "~0.7.0",
63
63
  "style-loader": "^3.3.1",
64
- "terser-webpack-plugin": "^5.2.5",
64
+ "terser-webpack-plugin": "^5.3.0",
65
65
  "thread-loader": "^3.0.4",
66
66
  "url-loader": "^4.1.1",
67
- "webpack": "^5.64.4",
67
+ "webpack": "^5.65.0",
68
68
  "webpack-bundle-analyzer": "^4.5.0",
69
69
  "webpack-cli": "^4.9.1",
70
70
  "webpack-node-externals": "^3.0.0",
@@ -74,7 +74,7 @@
74
74
  "@types/clean-webpack-plugin": "^0.1.3",
75
75
  "@types/ip": "^1.1.0",
76
76
  "@types/mini-css-extract-plugin": "^2.4.0",
77
- "@types/node": "^16.11.11",
77
+ "@types/node": "^17.0.8",
78
78
  "@types/terser-webpack-plugin": "^5.2.0",
79
79
  "@types/webpack-bundle-analyzer": "^4.4.1",
80
80
  "@types/webpack-env": "^1.16.3",
@@ -85,5 +85,5 @@
85
85
  "build",
86
86
  "hmr"
87
87
  ],
88
- "gitHead": "9d4de3a9c295ffa38a7bf06217fd8955528fd9ee"
88
+ "gitHead": "c92b63a632cc91df2fbfc342ae638ddee694f62c"
89
89
  }