weboptimizer 4.0.16 → 4.0.18

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Browser, InitializedBrowser } from './type';
2
+ import { Logger } from 'clientnode';
2
3
  export declare const browser: Browser;
3
- export declare const log: any;
4
+ export declare const log: Logger;
4
5
  /**
5
6
  * Provides a generic browser api in node or web contexts.
6
7
  * @param replaceWindow - Indicates whether a potential existing window object
package/browser.js CHANGED
@@ -17,6 +17,7 @@
17
17
  */
18
18
  // region imports
19
19
  import { CONSOLE_METHODS, Logger, timeout } from 'clientnode';
20
+ import webOptimizerDefaultTemplate from 'webOptimizerDefaultTemplateFilePath';
20
21
  // endregion
21
22
  // region declaration
22
23
 
@@ -92,6 +93,7 @@ if (typeof TARGET_TECHNOLOGY === 'undefined' || TARGET_TECHNOLOGY === 'node')
92
93
  virtualConsole
93
94
  });
94
95
  };
96
+ let evaluatedContent = '';
95
97
  if (typeof NAME === 'undefined' || NAME === 'webOptimizer') {
96
98
  const filePath = path.join(import.meta.dirname, 'index.html.ejs');
97
99
  /*
@@ -102,15 +104,14 @@ if (typeof TARGET_TECHNOLOGY === 'undefined' || TARGET_TECHNOLOGY === 'node')
102
104
  const content = await (await import('fs')).promises.readFile(filePath, {
103
105
  encoding: 'utf-8'
104
106
  });
105
- let evaluatedContent = '';
106
107
  await ejsLoader.bind({
107
108
  resourcePath: filePath,
108
109
  async: (error, result) => {
109
110
  if (error) throw error;else evaluatedContent = result;
110
111
  }
111
112
  })(content);
112
- render(evaluatedContent);
113
- } else render(await import('webOptimizerDefaultTemplateFilePath'));
113
+ } else evaluatedContent = webOptimizerDefaultTemplate;
114
+ render(evaluatedContent);
114
115
  // endregion
115
116
  })().catch(error => {
116
117
  log.error(error);
package/configurator.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import type { ResolvedConfiguration } from './type';
2
+ import { Logger } from 'clientnode';
2
3
  export declare const require: NodeJS.Require;
3
4
  export declare const optionalRequire: <T = unknown>(id: string) => null | T;
4
5
  export declare let loadedConfiguration: null | ResolvedConfiguration;
5
- export declare const log: any;
6
+ export declare const log: Logger;
6
7
  /**
7
8
  * Main entry point to determine current configuration.
8
9
  * @param context - Location from where to build current application.
package/ejsLoader.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { Encoding, Mapping } from 'clientnode';
2
2
  import type { Options, AsyncTemplateFunction as EJSAsyncTemplateFunction } from 'ejs';
3
3
  import type { LoaderContext } from 'webpack';
4
4
  import type { Extensions, Replacements } from './type';
5
+ import { Logger } from 'clientnode';
5
6
  export type TemplateFunction = EJSAsyncTemplateFunction;
6
7
  export type CompilerOptions = Options & {
7
8
  encoding: Encoding;
@@ -24,7 +25,7 @@ export type LoaderConfiguration = Mapping<unknown> & {
24
25
  replacements: Replacements;
25
26
  };
26
27
  };
27
- export declare const log: any;
28
+ export declare const log: Logger;
28
29
  /**
29
30
  * Main transformation function.
30
31
  * @param source - Input string to transform.
package/helper.d.ts CHANGED
@@ -1,7 +1,8 @@
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';
3
4
  export declare const KNOWN_FILE_EXTENSIONS: Array<string>;
4
- export declare const log: any;
5
+ export declare const log: Logger;
5
6
  /**
6
7
  * Determines whether given file path is within given list of file locations.
7
8
  * @param filePath - Path to file to check.
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env babel-node
2
- export declare const log: any;
2
+ import { Logger } from 'clientnode';
3
+ export declare const log: Logger;
3
4
  /**
4
5
  * Main entry point.
5
6
  * @param context - Location from where to build current application.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "4.0.16",
3
+ "version": "4.0.18",
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.1437",
98
+ "clientnode": "4.0.1442",
99
99
  "core-js": "^3.49.0",
100
100
  "ejs": "^6.0.1",
101
101
  "exports-loader": "^5.0.0",
@@ -114,7 +114,7 @@
114
114
  "webpack-sources": "^3.5.1"
115
115
  },
116
116
  "devDependencies": {
117
- "@babel/cli": "^8.0.1",
117
+ "@babel/cli": "^8.0.4",
118
118
  "@babel/eslint-parser": "^8.0.1",
119
119
  "@eslint/js": "^10.0.1",
120
120
  "@stylistic/eslint-plugin": "^5.10.0",
@@ -333,7 +333,8 @@
333
333
  "exports": {
334
334
  ".": "/.index.js",
335
335
  "./browser": "./browser.js",
336
- "./ejsLoader": "./ejsLoader.js"
336
+ "./ejsLoader": "./ejsLoader.js",
337
+ "./type": "./type.js"
337
338
  },
338
339
  "webDocumentation": {
339
340
  "trackingCode": "UA-40192634-11"
@@ -741,8 +742,7 @@
741
742
  "cascadingStyleSheetFileExtension": "css",
742
743
  "isWeb": true,
743
744
  "supportedBrowsers": [
744
- "last 2 major versions",
745
- "> 5%"
745
+ "last 2 major versions"
746
746
  ],
747
747
  "testCommandLine": "node --experimental-vm-modules node_modules/.bin/jest --config node_modules/weboptimizer/jest.json --noStackTrace --test-regex",
748
748
  "testCommandLineCoverageArguments": "--ci --coverage --coverage-reporters=text --coverage-reporters=text-summary --silent --test-location-in-results"
@@ -1529,6 +1529,12 @@
1529
1529
  "offline": null
1530
1530
  },
1531
1531
  "webpack": {
1532
+ "output": {
1533
+ "environment": {
1534
+ "dynamicImport": true,
1535
+ "module": true
1536
+ }
1537
+ },
1532
1538
  "watchOptions": {
1533
1539
  "ignored": [
1534
1540
  "./*.js",
package/type.js CHANGED
@@ -35,10 +35,6 @@ export const TaskTypes = ['build', 'serve', ...SubConfigurationTypes];
35
35
 
36
36
  //// endregion
37
37
 
38
- /* eslint-disable max-len */
39
-
40
- /* eslint-enable max-len */
41
-
42
38
  /// endregion
43
39
  // NOTE: Not yet defined in webpack types.
44
40
 
@@ -1,4 +1,5 @@
1
1
  import type { WebpackConfiguration } from './type';
2
- export declare const log: any;
2
+ import { Logger } from 'clientnode';
3
+ export declare const log: Logger;
3
4
  export declare let webpackConfiguration: WebpackConfiguration;
4
5
  export default webpackConfiguration;