weboptimizer 2.0.1429 → 2.0.1435

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.
package/type.d.ts DELETED
@@ -1,483 +0,0 @@
1
- /// <reference types="webpack-env" />
2
- /// <reference types="node" />
3
- import { AnyFunction, Encoding, Mapping, PlainObject, SecondParameter } from 'clientnode/type';
4
- import FaviconWebpackPlugin from 'favicons-webpack-plugin';
5
- import { FaviconWebpackPlugionOptions as FaviconWebpackPluginOptions } from 'favicons-webpack-plugin/src/options';
6
- import HtmlWebpackPlugin from 'html-webpack-plugin';
7
- import ImageMinimizerWebpackPlugin, { PluginOptions as ImageMinimizerOptions } from 'image-minimizer-webpack-plugin';
8
- import { JSDOM } from 'jsdom';
9
- import MiniCSSExtractPlugin from 'mini-css-extract-plugin';
10
- import TerserWebpackPlugin from 'terser-webpack-plugin';
11
- import { DefinePlugin as WebpackDefinePlugin, Configuration as BaseWebpackConfiguration, IgnorePlugin as WebpackIgnorePlugin, library as webpackLibrary, ModuleOptions as WebpackModuleOptions, RuleSetRule as WebpackRuleSetRule, RuleSetUseItem as WebpackRuleSetUseItem, WebpackOptionsNormalized } from 'webpack';
12
- import { WebpackPartial as WorkboxBaseCommonOptions, BasePartial as WorkboxCommonOptions, WebpackGenerateSWOptions as WorkboxGenerateSWOptions, WebpackInjectManifestOptions as WorkboxInjectManifestOptions } from 'workbox-build';
13
- import OfflinePlugin from 'workbox-webpack-plugin';
14
- export interface Browser {
15
- debug: boolean;
16
- domContentLoaded: boolean;
17
- DOM: typeof JSDOM | null;
18
- initialized: boolean;
19
- instance: JSDOM | null;
20
- window: null | Window;
21
- windowLoaded: boolean;
22
- }
23
- export interface InitializedBrowser extends Browser {
24
- DOM: typeof JSDOM;
25
- instance: JSDOM;
26
- window: Window;
27
- }
28
- export interface PackageConfiguration {
29
- name: string;
30
- version: string;
31
- }
32
- export interface PackageDescriptor {
33
- configuration: PackageConfiguration;
34
- filePath: string;
35
- }
36
- export type Replacements = Mapping<SecondParameter<string['replace']>>;
37
- export type Resolvable = {
38
- [_K in '__evaluate__' | '__execute__']?: Resolvable;
39
- } & Mapping<unknown>;
40
- export interface RedundantRequest {
41
- path: string;
42
- version: string;
43
- }
44
- export type ExternalAliases = Mapping<Mapping | string | ((_request: string, _key: string) => string)>;
45
- export type GivenInjection = AnyFunction | string | Array<string> | Mapping<string | Array<string>>;
46
- export type NormalizedGivenInjection = Mapping<Array<string>>;
47
- export interface GivenInjectionConfiguration {
48
- autoExclude: Array<string>;
49
- entry: GivenInjection;
50
- external: GivenInjection;
51
- }
52
- export type IgnorePattern = WebpackIgnorePlugin['options'] | {
53
- contextRegExp?: string;
54
- resourceRegExp?: string;
55
- };
56
- export interface InjectionConfiguration {
57
- autoExclude: Array<string>;
58
- chunks: NonNullable<BaseWebpackConfiguration['optimization']>['splitChunks'];
59
- entry: {
60
- given: GivenInjection;
61
- normalized: NormalizedGivenInjection;
62
- };
63
- external: {
64
- aliases: ExternalAliases;
65
- implicit: {
66
- pattern: {
67
- exclude: Array<RegExp | string>;
68
- include: Array<RegExp | string>;
69
- };
70
- };
71
- modules: BaseWebpackConfiguration['externals'];
72
- };
73
- externalAliases: Mapping;
74
- ignorePattern: Array<IgnorePattern> | IgnorePattern;
75
- implicitExternalExcludePattern: Array<RegExp | string>;
76
- implicitExternalIncludePattern: Array<RegExp | string>;
77
- }
78
- export interface HTMLTransformationOptions {
79
- hashAlgorithm: string;
80
- htmlPlugin: typeof HtmlWebpackPlugin;
81
- files: Array<HTMLConfiguration>;
82
- }
83
- export interface InPlaceAssetsIntoHTMLOptions {
84
- cascadingStyleSheet: InPlaceAssetConfiguration;
85
- javaScript: InPlaceAssetConfiguration;
86
- htmlPlugin: typeof HtmlWebpackPlugin;
87
- }
88
- export interface AssetPathConfiguration {
89
- base: string;
90
- cascadingStyleSheet: string;
91
- data: string;
92
- font: string;
93
- image: string;
94
- javaScript: string;
95
- template: string;
96
- }
97
- export interface BasePathConfiguration {
98
- base: string;
99
- context: string;
100
- source: {
101
- asset: AssetPathConfiguration;
102
- base: string;
103
- };
104
- target: {
105
- asset: AssetPathConfiguration;
106
- base: string;
107
- manifest: string;
108
- public: string;
109
- };
110
- }
111
- export interface PathConfiguration extends BasePathConfiguration {
112
- apiDocumentation: string;
113
- base: string;
114
- configuration: {
115
- javaScript: string;
116
- json: string;
117
- typeScript: string;
118
- };
119
- context: string;
120
- ignore: Array<string>;
121
- tidyUp: Array<string>;
122
- tidyUpGlobs: Array<string>;
123
- tidyUpOnClear: Array<string>;
124
- tidyUpOnClearGlobs: Array<string>;
125
- }
126
- export type DefaultPathConfiguration = BasePathConfiguration & Resolvable;
127
- export interface BuildConfigurationItem {
128
- extension: string;
129
- ignoredExtension: string;
130
- filePathPattern: string;
131
- outputExtension: string;
132
- }
133
- export type BuildConfiguration = Mapping<BuildConfigurationItem>;
134
- export declare const SubConfigurationTypes: readonly ["debug", "document", "test", "test:browser"];
135
- export declare const TaskTypes: readonly ["build", "serve", "debug", "document", "test", "test:browser"];
136
- export type BooleanExpression = boolean | null | string;
137
- export interface AdditionalLoaderConfiguration {
138
- exclude?: BooleanExpression;
139
- include?: BooleanExpression;
140
- test: string;
141
- use: Array<WebpackLoader> | WebpackLoader | string;
142
- }
143
- export interface AdditionalLoaderConfigurations {
144
- post: Array<AdditionalLoaderConfiguration>;
145
- pre: Array<AdditionalLoaderConfiguration>;
146
- }
147
- export interface AdditionalLoader {
148
- post: Array<string>;
149
- pre: Array<string>;
150
- }
151
- export interface WebpackLoader {
152
- loader: string;
153
- options?: Mapping<unknown>;
154
- }
155
- export type ResourceLoaderConfiguration = WebpackLoader & {
156
- exclude: BooleanExpression;
157
- include: BooleanExpression;
158
- loader: Array<string>;
159
- regularExpression: string;
160
- };
161
- export interface LoaderConfiguration extends ResourceLoaderConfiguration {
162
- additional: AdditionalLoaderConfigurations;
163
- }
164
- export interface WebpackLoaderConfiguration {
165
- exclude: WebpackLoaderIndicator;
166
- include: WebpackLoaderIndicator;
167
- test: RegExp;
168
- use: Array<WebpackLoader> | WebpackLoader;
169
- }
170
- export type WebpackLoaderIndicator = WebpackRuleSetRule['include'];
171
- export interface Command {
172
- arguments: Array<string>;
173
- command: string;
174
- indicator?: string;
175
- }
176
- export interface CommandLineArguments {
177
- build: Command;
178
- document: Array<Command> | Command;
179
- lint: Array<Command> | Command;
180
- serve: Array<Command> | Command;
181
- test: Array<Command> | Command;
182
- 'test:browser': Array<Command> | Command;
183
- 'check:types': Array<Command> | Command;
184
- }
185
- export type NodeEnvironment = BaseWebpackConfiguration['node'] & {
186
- '#': string;
187
- };
188
- export interface PluginConfiguration {
189
- name: {
190
- initializer: string;
191
- module: string;
192
- };
193
- parameters: Array<unknown>;
194
- }
195
- export interface DefaultConfiguration {
196
- contextType: string;
197
- debug: boolean;
198
- document: PlainObject;
199
- encoding: Encoding;
200
- givenCommandLineArguments: Array<string>;
201
- library: boolean;
202
- nodeEnvironment: NodeEnvironment;
203
- path: DefaultPathConfiguration;
204
- plugins: Array<PluginConfiguration>;
205
- test: PlainObject;
206
- 'test:browser': PlainObject;
207
- }
208
- export type ExportFormat = 'amd' | 'amd-require' | 'assign' | 'global' | 'jsonp' | 'var' | 'this' | 'commonjs' | 'commonjs2' | 'umd';
209
- export interface HTMLConfiguration {
210
- filename: string;
211
- template: {
212
- filePath: string;
213
- options?: PlainObject;
214
- postCompileOptions: PlainObject;
215
- request: string;
216
- use: Array<WebpackLoader> | WebpackLoader;
217
- };
218
- }
219
- export interface MetaConfiguration {
220
- default: DefaultConfiguration;
221
- debug: Resolvable;
222
- library: Resolvable;
223
- }
224
- export interface ResolvedBuildConfigurationItem extends BuildConfigurationItem {
225
- filePaths: Array<string>;
226
- type: string;
227
- }
228
- export interface Extensions {
229
- file: {
230
- external: Array<string>;
231
- internal: Array<string>;
232
- };
233
- }
234
- export interface SpecificExtensions {
235
- file: Array<string>;
236
- }
237
- export interface InPlaceAssetConfiguration {
238
- body?: Array<RegExp | string> | RegExp | string;
239
- head?: Array<RegExp | string> | RegExp | string;
240
- }
241
- export interface InPlaceConfiguration {
242
- cascadingStyleSheet: InPlaceAssetConfiguration;
243
- externalLibrary: {
244
- normal: boolean;
245
- dynamic: boolean;
246
- };
247
- javaScript: InPlaceAssetConfiguration;
248
- otherMaximumFileSizeLimitInByte: number;
249
- }
250
- export interface ResolvedConfiguration {
251
- assetPattern: Mapping<{
252
- excludeFilePathRegularExpression: string;
253
- includeFilePathRegularExpression: string;
254
- pattern: string;
255
- }>;
256
- buildContext: {
257
- definitions: WebpackDefinePlugin['definitions'];
258
- types: BuildConfiguration;
259
- };
260
- cache?: {
261
- main?: WebpackOptionsNormalized['cache'];
262
- unsafe?: WebpackModuleOptions['unsafeCache'];
263
- };
264
- commandLine: CommandLineArguments;
265
- contextType: string;
266
- debug: boolean;
267
- development: {
268
- includeClient?: boolean | null;
269
- server: (WebpackOptionsNormalized['devServer'] & {
270
- hot: boolean;
271
- host: string;
272
- https: boolean;
273
- liveReload: boolean;
274
- port: number;
275
- });
276
- tool: WebpackOptionsNormalized['devtool'];
277
- };
278
- document: PlainObject;
279
- encoding: Encoding;
280
- exportFormat: {
281
- external: ExportFormat;
282
- globalObject: string;
283
- self: ExportFormat;
284
- };
285
- extensions: Extensions;
286
- favicon: FaviconWebpackPluginOptions;
287
- files: {
288
- additionalPaths: Array<string>;
289
- compose: {
290
- cascadingStyleSheet: string | ((_asset: unknown) => string);
291
- image: string;
292
- javaScript: string;
293
- };
294
- defaultHTML: HTMLConfiguration;
295
- html: Array<HTMLConfiguration>;
296
- };
297
- givenCommandLineArguments: Array<string>;
298
- hashAlgorithm: string;
299
- injection: InjectionConfiguration;
300
- inPlace: InPlaceConfiguration;
301
- library: boolean;
302
- libraryName: string;
303
- loader: {
304
- aliases: Mapping;
305
- directoryNames: Array<string>;
306
- extensions: {
307
- file: Array<string>;
308
- };
309
- resolveSymlinks: boolean;
310
- };
311
- module: {
312
- additional: AdditionalLoaderConfigurations;
313
- aliases: Mapping;
314
- cascadingStyleSheet: ResourceLoaderConfiguration;
315
- directoryNames: Array<string>;
316
- enforceDeduplication: boolean;
317
- html: LoaderConfiguration;
318
- locations: {
319
- directoryPaths: Array<string>;
320
- filePaths: Array<string>;
321
- };
322
- optimizer: BaseWebpackConfiguration['optimization'] & {
323
- babelMinify?: {
324
- bundle?: {
325
- plugin?: PlainObject;
326
- transform?: PlainObject;
327
- };
328
- module?: PlainObject;
329
- };
330
- cssnano: PlainObject;
331
- data: ResourceLoaderConfiguration;
332
- font: {
333
- eot: ResourceLoaderConfiguration;
334
- svg: ResourceLoaderConfiguration;
335
- ttf: ResourceLoaderConfiguration;
336
- woff: ResourceLoaderConfiguration;
337
- };
338
- htmlMinifier?: PlainObject;
339
- image: {
340
- content: ImageMinimizerOptions<unknown, unknown>;
341
- exclude: string;
342
- loader: Array<string>;
343
- };
344
- };
345
- preprocessor: {
346
- cascadingStyleSheet: WebpackLoader & {
347
- additional: AdditionalLoader & {
348
- plugins: AdditionalLoader;
349
- };
350
- postcssPresetEnv: PlainObject;
351
- };
352
- ejs: LoaderConfiguration;
353
- html: LoaderConfiguration;
354
- javaScript: LoaderConfiguration;
355
- json: {
356
- exclude: string;
357
- loader: string;
358
- };
359
- };
360
- provide: Mapping | null;
361
- replacements: {
362
- context: Array<[string, string]>;
363
- normal: Replacements;
364
- };
365
- resolveSymlinks: boolean;
366
- skipParseRegularExpressions: WebpackModuleOptions['noParse'];
367
- style: WebpackLoader;
368
- };
369
- name: string;
370
- needed: Mapping<boolean>;
371
- nodeENV: false | null | string;
372
- nodeEnvironment: NodeEnvironment;
373
- offline: {
374
- common: WorkboxBaseCommonOptions & WorkboxCommonOptions;
375
- injectionManifest: WorkboxInjectManifestOptions;
376
- serviceWorker: WorkboxGenerateSWOptions;
377
- use: 'injectionManifest' | 'serviceWorker';
378
- };
379
- package: {
380
- aliasPropertyNames: Array<string>;
381
- main: {
382
- fileNames: Array<string>;
383
- propertyNames: Array<string>;
384
- };
385
- };
386
- path: PathConfiguration;
387
- performanceHints: BaseWebpackConfiguration['performance'];
388
- plugins: Array<PluginConfiguration>;
389
- showConfiguration: boolean;
390
- stylelint: PlainObject;
391
- targetTechnology: {
392
- boilerplate: string;
393
- payload: string;
394
- };
395
- test: PlainObject;
396
- 'test:browser': PlainObject;
397
- webpack: WebpackConfiguration;
398
- }
399
- export type ResolvedBuildConfiguration = Array<ResolvedBuildConfigurationItem>;
400
- export type RuntimeInformation = PlainObject & {
401
- givenCommandLineArguments: Array<string>;
402
- };
403
- export interface WebpackConfiguration extends BaseWebpackConfiguration {
404
- devServer: Mapping<unknown>;
405
- replaceWebOptimizer: WebpackConfiguration;
406
- }
407
- export type RuleSet = Array<WebpackRuleSetUseItem>;
408
- export type RuleSetRule = WebpackRuleSetRule & {
409
- use: RuleSet;
410
- };
411
- export interface GenericLoader {
412
- ejs: RuleSetRule;
413
- script: RuleSetRule;
414
- html: {
415
- ejs: RuleSetRule;
416
- html: RuleSetRule;
417
- main: {
418
- test: RegExp;
419
- use: Array<WebpackLoader> | WebpackLoader;
420
- };
421
- };
422
- style: RuleSetRule;
423
- font: {
424
- eot: RuleSetRule;
425
- svg: RuleSetRule;
426
- ttf: RuleSetRule;
427
- woff: RuleSetRule;
428
- };
429
- image: RuleSetRule;
430
- data: RuleSetRule;
431
- }
432
- export type Loader = GenericLoader & Mapping<WebpackRuleSetRule>;
433
- export interface EvaluationScope {
434
- configuration: ResolvedConfiguration;
435
- isFilePathInDependencies: (_filePath: string) => boolean;
436
- loader: Loader;
437
- require: typeof require;
438
- }
439
- export interface WebpackBaseAssets {
440
- outputName: string;
441
- plugin: HtmlWebpackPlugin;
442
- }
443
- export interface WebpackAssets extends WebpackBaseAssets {
444
- bodyTags: HtmlWebpackPlugin.HtmlTagObject[];
445
- headTags: HtmlWebpackPlugin.HtmlTagObject[];
446
- outputName: string;
447
- publicPath: string;
448
- plugin: HtmlWebpackPlugin;
449
- }
450
- export type WebpackPlugin = webpackLibrary.AbstractLibraryPlugin<unknown> & Mapping<unknown>;
451
- export type WebpackPlugins = Mapping<WebpackPlugin> & {
452
- Favicon?: typeof FaviconWebpackPlugin;
453
- GenerateServiceWorker?: typeof OfflinePlugin.GenerateSW;
454
- HTML?: typeof HtmlWebpackPlugin;
455
- ImageMinimizer?: typeof ImageMinimizerWebpackPlugin;
456
- InjectManifest?: typeof OfflinePlugin.InjectManifest;
457
- Offline?: {
458
- GenerateSW: typeof OfflinePlugin.GenerateSW;
459
- InjectManifest: typeof OfflinePlugin.InjectManifest;
460
- };
461
- MiniCSSExtract?: typeof MiniCSSExtractPlugin;
462
- Terser?: typeof TerserWebpackPlugin;
463
- };
464
- export type WebpackResolveData = Parameters<WebpackIgnorePlugin['checkIgnore']>[0];
465
- export type WebpackExtendedResolveData = WebpackResolveData & {
466
- createData: {
467
- rawRequest: string;
468
- request: string;
469
- resource: string;
470
- userRequest: string;
471
- };
472
- };
473
- export interface HTMLWebpackPluginAssetTagGroupsData {
474
- bodyTags: HtmlWebpackPlugin.HtmlTagObject[];
475
- headTags: HtmlWebpackPlugin.HtmlTagObject[];
476
- outputName: string;
477
- plugin: HtmlWebpackPlugin;
478
- }
479
- export interface HTMLWebpackPluginBeforeEmitData {
480
- html: string;
481
- outputName: string;
482
- plugin: HtmlWebpackPlugin;
483
- }
@@ -1,4 +0,0 @@
1
- import { WebpackConfiguration } from './type';
2
- export declare const optionalRequire: <T = unknown>(id: string) => T | null;
3
- export declare let webpackConfiguration: WebpackConfiguration;
4
- export default webpackConfiguration;