weboptimizer 2.0.1514 → 2.0.1515

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
@@ -30,5 +30,5 @@ export type LoaderConfiguration = Mapping<unknown> & {
30
30
  * @param source - Input string to transform.
31
31
  * @returns Transformed string.
32
32
  */
33
- export declare const loader: (this: LoaderContext<LoaderConfiguration>, source: string) => string;
33
+ export declare const loader: (this: Partial<LoaderContext<LoaderConfiguration>>, source: string) => string;
34
34
  export default loader;
package/ejsLoader.js CHANGED
@@ -46,7 +46,8 @@ var configuration = (0, _configurator["default"])();
46
46
  * @returns Transformed string.
47
47
  */
48
48
  var loader = exports.loader = function loader(source) {
49
- var _this = this,
49
+ var _ref,
50
+ _this = this,
50
51
  _givenOptions$compile;
51
52
  var givenOptions = (0, _clientnode.convertSubstringInPlainObject)((0, _clientnode.extend)(true, {
52
53
  compiler: {},
@@ -67,7 +68,7 @@ var loader = exports.loader = function loader(source) {
67
68
  aliases: {},
68
69
  replacements: {}
69
70
  }
70
- }, Object.prototype.hasOwnProperty.call(this, 'getOptions') ? this.getOptions() : {}), /#%%%#/g, '!');
71
+ }, this.getOptions ? this.getOptions() : (_ref = this.query) !== null && _ref !== void 0 ? _ref : {}), /#%%%#/g, '!');
71
72
  var _compile = function compile(template) {
72
73
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : givenOptions.compiler;
73
74
  var compileSteps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
@@ -102,7 +103,7 @@ var loader = exports.loader = function loader(source) {
102
103
  file: ((_givenOptions$extensi = givenOptions.extensions) === null || _givenOptions$extensi === void 0 ? void 0 : _givenOptions$extensi.file.internal) || []
103
104
  }, givenOptions.context, configuration.path.source.asset.base, configuration.path.ignore, configuration.module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding);
104
105
  if (templateFilePath) {
105
- if ('addDependency' in _this) _this.addDependency(templateFilePath);
106
+ if (_this.addDependency) _this.addDependency(templateFilePath);
106
107
  /*
107
108
  NOTE: If there aren't any locals options or variables and
108
109
  file doesn't seem to be an ejs template we simply load
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "2.0.1514",
3
+ "version": "2.0.1515",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",