weboptimizer 4.0.5 → 4.0.7
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/browser.d.ts +1 -2
- package/configurator.d.ts +1 -2
- package/configurator.js +4 -4
- package/ejsLoader.d.ts +1 -2
- package/helper.d.ts +1 -2
- package/index.d.ts +1 -2
- package/index.js +4 -1
- package/package.json +4 -4
- package/webpackConfigurator.d.ts +1 -2
package/browser.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Browser, InitializedBrowser } from './type';
|
|
2
|
-
import { Logger } from 'clientnode';
|
|
3
2
|
export declare const browser: Browser;
|
|
4
|
-
export declare const log:
|
|
3
|
+
export declare const log: any;
|
|
5
4
|
/**
|
|
6
5
|
* Provides a generic browser api in node or web contexts.
|
|
7
6
|
* @param replaceWindow - Indicates whether a potential existing window object
|
package/configurator.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ResolvedConfiguration } from './type';
|
|
2
|
-
import { Logger } from 'clientnode';
|
|
3
2
|
export declare const require: NodeJS.Require;
|
|
4
3
|
export declare const optionalRequire: <T = unknown>(id: string) => null | T;
|
|
5
4
|
export declare let loadedConfiguration: null | ResolvedConfiguration;
|
|
6
|
-
export declare const log:
|
|
5
|
+
export declare const log: any;
|
|
7
6
|
/**
|
|
8
7
|
* Main entry point to determine current configuration.
|
|
9
8
|
* @param context - Location from where to build current application.
|
package/configurator.js
CHANGED
|
@@ -78,7 +78,7 @@ import "core-js/modules/es.iterator.filter.js";
|
|
|
78
78
|
import "core-js/modules/es.iterator.map.js";
|
|
79
79
|
import "core-js/modules/es.iterator.some.js";
|
|
80
80
|
import "core-js/modules/es.json.parse.js";
|
|
81
|
-
import { convertCircularObjectToJSON, copy, evaluateDynamicData, extend, getUTCTimestamp, importsPromise, isFileSync, isObject,
|
|
81
|
+
import { convertCircularObjectToJSON, copy, evaluateAsyncDynamicData, evaluateDynamicData, extend, getUTCTimestamp, importsPromise, isFileSync, isObject, isPlainObject, Logger, MAXIMAL_NUMBER_OF_ITERATIONS, modifyObject, optionalImport, parseEncodedObject, removeKeyPrefixes, UTILITY_SCOPE } from 'clientnode';
|
|
82
82
|
import fileSystem, { lstatSync, readFileSync, unlinkSync } from 'fs';
|
|
83
83
|
import { createRequire } from 'node:module';
|
|
84
84
|
import path, { basename, dirname, join, resolve } from 'path';
|
|
@@ -250,7 +250,7 @@ environment = eval('process.env')) => {
|
|
|
250
250
|
NOTE: The configuration is not yet fully resolved but will be
|
|
251
251
|
transformed in place in the following lines of code.
|
|
252
252
|
*/
|
|
253
|
-
const
|
|
253
|
+
const evaluationOptions = {
|
|
254
254
|
scope: {
|
|
255
255
|
...UTILITY_SCOPE,
|
|
256
256
|
currentPath: currentWorkingDirectory,
|
|
@@ -258,12 +258,12 @@ environment = eval('process.env')) => {
|
|
|
258
258
|
optionalRequire,
|
|
259
259
|
packageConfiguration,
|
|
260
260
|
path,
|
|
261
|
-
require: isolatedRequire,
|
|
262
261
|
webOptimizerPath,
|
|
263
262
|
now,
|
|
264
263
|
nowUTCTimestamp: getUTCTimestamp(now)
|
|
265
264
|
}
|
|
266
|
-
}
|
|
265
|
+
};
|
|
266
|
+
const resolvedConfiguration = await evaluateAsyncDynamicData(evaluateDynamicData(configuration, evaluationOptions), evaluationOptions);
|
|
267
267
|
// endregion
|
|
268
268
|
// region consolidate file specific build configuration
|
|
269
269
|
// Apply default file level build configurations to all file type specific
|
package/ejsLoader.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { Encoding, Mapping } from 'clientnode';
|
|
|
2
2
|
import type { Options, TemplateFunction as EJSTemplateFunction } from 'ejs';
|
|
3
3
|
import type { LoaderContext } from 'webpack';
|
|
4
4
|
import type { Extensions, Replacements } from './type';
|
|
5
|
-
import { Logger } from 'clientnode';
|
|
6
5
|
export type TemplateFunction = EJSTemplateFunction;
|
|
7
6
|
export type CompilerOptions = Options & {
|
|
8
7
|
encoding: Encoding;
|
|
@@ -25,7 +24,7 @@ export type LoaderConfiguration = Mapping<unknown> & {
|
|
|
25
24
|
replacements: Replacements;
|
|
26
25
|
};
|
|
27
26
|
};
|
|
28
|
-
export declare const log:
|
|
27
|
+
export declare const log: any;
|
|
29
28
|
/**
|
|
30
29
|
* Main transformation function.
|
|
31
30
|
* @param source - Input string to transform.
|
package/helper.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Encoding, Mapping } from 'clientnode';
|
|
2
2
|
import type { BuildConfiguration, Extensions, GivenInjection, GivenInjectionConfiguration, NormalizedGivenInjection, PathConfiguration, PackageDescriptor, Replacements, ResolvedBuildConfiguration, SpecificExtensions } from './type';
|
|
3
|
-
import { Logger } from 'clientnode';
|
|
4
3
|
export declare const KNOWN_FILE_EXTENSIONS: Array<string>;
|
|
5
|
-
export declare const log:
|
|
4
|
+
export declare const log: any;
|
|
6
5
|
/**
|
|
7
6
|
* Determines whether given file path is within given list of file locations.
|
|
8
7
|
* @param filePath - Path to file to check.
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -27,7 +27,10 @@ import { exec as execChildProcess, spawn as spawnChildProcess } from 'child_proc
|
|
|
27
27
|
import { CLOSE_EVENT_NAMES, copyDirectoryRecursiveSync, copyFileSync, evaluate, getProcessCloseHandler, handleChildProcess, importsPromise, isDirectory, isDirectorySync, isFile, isFileSync, isPlainObject, Logger, MAXIMAL_NUMBER_OF_ITERATIONS, NOOP, parseEncodedObject, walkDirectoryRecursively } from 'clientnode';
|
|
28
28
|
import { chmodSync, unlinkSync } from 'fs';
|
|
29
29
|
import { writeFile, unlink } from 'fs/promises';
|
|
30
|
-
import
|
|
30
|
+
import globAll from 'glob-all';
|
|
31
|
+
const {
|
|
32
|
+
sync: globAllSync
|
|
33
|
+
} = globAll;
|
|
31
34
|
import path, { join, resolve } from 'path';
|
|
32
35
|
import { rimraf as removeDirectoryRecursively, sync as removeDirectoryRecursivelySync } from 'rimraf';
|
|
33
36
|
import { load as loadConfiguration } from "./configurator.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"babel-plugin-polyfill-corejs3": "^1.0.0",
|
|
96
96
|
"babel-plugin-transform-rewrite-imports": "^1.5.4",
|
|
97
97
|
"babel-preset-minify": "^0.5.2",
|
|
98
|
-
"clientnode": "4.0.
|
|
98
|
+
"clientnode": "4.0.1437",
|
|
99
99
|
"core-js": "^3.49.0",
|
|
100
100
|
"ejs": "^6.0.1",
|
|
101
101
|
"exports-loader": "^5.0.0",
|
|
@@ -946,7 +946,7 @@
|
|
|
946
946
|
"#": "The autoprefixer has to be disabled in this context since it would remove all needed vendor prefixes from the preceding processing (every prefix should be needed here).",
|
|
947
947
|
"preset": [
|
|
948
948
|
{
|
|
949
|
-
"
|
|
949
|
+
"__await_evaluate__": "module.optionalImport('cssnano-preset-default')"
|
|
950
950
|
},
|
|
951
951
|
{
|
|
952
952
|
"autoprefixer": false,
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
"pre": []
|
|
1085
1085
|
},
|
|
1086
1086
|
"loader": {
|
|
1087
|
-
"
|
|
1087
|
+
"__await_evaluate__": "module.optionalImport('postcss-loader').then((result) => result ? 'postcss-loader' : null)"
|
|
1088
1088
|
},
|
|
1089
1089
|
"options": {}
|
|
1090
1090
|
},
|
package/webpackConfigurator.d.ts
CHANGED