weboptimizer 2.0.1109 → 2.0.1113

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/ejsLoader.d.ts CHANGED
@@ -32,4 +32,5 @@ export declare type LoaderConfiguration = Mapping<unknown> & {
32
32
  *
33
33
  * @returns Transformed string.
34
34
  */
35
- export default function (this: LoaderContext<LoaderConfiguration>, source: string): string;
35
+ export declare const loader: (this: LoaderContext<LoaderConfiguration>, source: string) => string;
36
+ export default loader;
package/ejsLoader.js CHANGED
@@ -22,7 +22,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
22
22
  Object.defineProperty(exports, "__esModule", {
23
23
  value: true
24
24
  });
25
- exports["default"] = _default;
25
+ exports.loader = exports["default"] = void 0;
26
26
 
27
27
  var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
28
28
 
@@ -62,8 +62,9 @@ var configuration = (0, _configurator["default"])();
62
62
  * @returns Transformed string.
63
63
  */
64
64
 
65
- function _default(source) {
66
- var _this = this;
65
+ var loader = function loader(source) {
66
+ var _ref,
67
+ _this = this;
67
68
 
68
69
  var givenOptions = _clientnode["default"].convertSubstringInPlainObject(_clientnode["default"].extend(true, {
69
70
  compiler: {},
@@ -84,7 +85,7 @@ function _default(source) {
84
85
  aliases: {},
85
86
  replacements: {}
86
87
  }
87
- }, 'getOptions' in this ? this.getOptions() || {} : {}), /#%%%#/g, '!');
88
+ }, 'getOptions' in this && this.getOptions() ? this.getOptions() : (_ref = this.query) !== null && _ref !== void 0 ? _ref : {}), /#%%%#/g, '!');
88
89
 
89
90
  var compile = function compile(template) {
90
91
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : givenOptions.compiler;
@@ -143,7 +144,9 @@ function _default(source) {
143
144
  };
144
145
 
145
146
  var compressHTML = function compressHTML(content) {
146
- return givenOptions.compress.html ? (0, _htmlMinifier.minify)(content, _clientnode["default"].extend(true, {
147
+ var _givenOptions$compres;
148
+
149
+ return (_givenOptions$compres = givenOptions.compress) !== null && _givenOptions$compres !== void 0 && _givenOptions$compres.html ? (0, _htmlMinifier.minify)(content, _clientnode["default"].extend(true, {
147
150
  caseSensitive: true,
148
151
  collapseInlineTagWhitespace: true,
149
152
  collapseWhitespace: true,
@@ -165,7 +168,7 @@ function _default(source) {
165
168
  */
166
169
  trimCustomFragments: true,
167
170
  useShortDoctype: true
168
- }, givenOptions.compress.html)) : content;
171
+ }, givenOptions.compress.html || {})) : content;
169
172
  };
170
173
 
171
174
  var result = template;
@@ -268,7 +271,12 @@ function _default(source) {
268
271
  isString: true,
269
272
  localsName: 'scope'
270
273
  }), givenOptions.compileSteps)(givenOptions.locals || {});
271
- } // region vim modline
274
+ };
275
+
276
+ exports.loader = loader;
277
+ var _default = loader; // region vim modline
272
278
  // vim: set tabstop=4 shiftwidth=4 expandtab:
273
279
  // vim: foldmethod=marker foldmarker=region,endregion:
274
280
  // endregion
281
+
282
+ exports["default"] = _default;
package/index.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  #!/usr/bin/env babel-node
2
+ /// <reference types="node" />
3
+ /// <reference types="webpack-env" />
2
4
  /**
3
5
  * Main entry point.
4
6
  * @param context - Location from where to build current application.
7
+ * @param currentWorkingDirectory - Current working directory to use as
8
+ * reference.
9
+ * @param commandLineArguments - Arguments to take into account.
10
+ * @param webOptimizerPath - Current optimizer context path.
11
+ * @param environment - Environment variables to take into account.
5
12
  *
6
13
  * @returns Nothing.
7
14
  */
8
- declare const main: (context?: string | undefined) => Promise<void>;
15
+ declare const main: (context?: string | undefined, currentWorkingDirectory?: string, commandLineArguments?: Array<string>, webOptimizerPath?: string, environment?: NodeJS.ProcessEnv) => Promise<() => void>;
9
16
  export default main;