weboptimizer 4.0.58 → 4.0.59

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.js CHANGED
@@ -77,11 +77,13 @@ export const loader = async function (source) {
77
77
  const queryMatch = /^[^?]+\?(.+)$/.exec(request);
78
78
  if (queryMatch) {
79
79
  const evaluated = evaluate(queryMatch[1], {
80
- compile,
81
- locals,
82
- request,
83
- source,
84
- template
80
+ scope: {
81
+ compile,
82
+ locals,
83
+ request,
84
+ source,
85
+ template
86
+ }
85
87
  });
86
88
  if (evaluated.error) log.warn('Error occurred during processing given query:', evaluated.error);else if (evaluated.result) extend(true, nestedLocals, evaluated.result);
87
89
  }
package/index.js CHANGED
@@ -220,12 +220,14 @@ environment = eval('process.env')) => {
220
220
  const expression = buildConfiguration[configuration.givenCommandLineArguments[2]].trim();
221
221
  for (const filePath of buildConfiguration.filePaths) if (!testModuleFilePaths.includes(filePath)) {
222
222
  const evaluated = evaluate(`\`${expression}\``, {
223
- global,
224
- self: configuration,
225
- buildConfiguration,
226
- path,
227
- additionalArguments,
228
- filePath
223
+ scope: {
224
+ global,
225
+ self: configuration,
226
+ buildConfiguration,
227
+ path,
228
+ additionalArguments,
229
+ filePath
230
+ }
229
231
  });
230
232
  if (evaluated.error) throw new Error('Error occurred during processing given ' + `command: ${evaluated.error}`);
231
233
  log.info(`Running "${evaluated.result}"`);
@@ -247,9 +249,11 @@ environment = eval('process.env')) => {
247
249
  const tasks = Array.isArray(configuration.commandLine[type]) ? configuration.commandLine[type] : [configuration.commandLine[type]];
248
250
  for (const task of tasks) {
249
251
  const evaluated = evaluate(Object.prototype.hasOwnProperty.call(task, 'indicator') ? task.indicator : 'true', {
250
- global,
251
- self: configuration,
252
- path
252
+ scope: {
253
+ global,
254
+ self: configuration,
255
+ path
256
+ }
253
257
  });
254
258
  if (evaluated.error) throw new Error('Error occurred during processing given task: ' + evaluated.error);
255
259
  if (evaluated.result) processPromises.push(new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "4.0.58",
3
+ "version": "4.0.59",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -102,7 +102,7 @@
102
102
  "babel-loader": "^10.1.1",
103
103
  "babel-plugin-polyfill-corejs3": "^1.0.0",
104
104
  "babel-plugin-transform-rewrite-imports": "^1.5.4",
105
- "clientnode": "4.0.1489",
105
+ "clientnode": "4.0.1490",
106
106
  "core-js": "^3.50.0",
107
107
  "ejs": "^6.0.1",
108
108
  "exports-loader": "^5.0.0",
@@ -154,7 +154,7 @@
154
154
  "postcss-fontpath": "^1.0.0",
155
155
  "postcss-import": "^17.0.0",
156
156
  "postcss-loader": "^8.2.1",
157
- "postcss-preset-env": "^11.4.0",
157
+ "postcss-preset-env": "^11.5.0",
158
158
  "postcss-sprites": "^4.2.1",
159
159
  "postcss-url": "^10.1.4",
160
160
  "shx": "^0.4.0",
@@ -989,7 +989,7 @@
989
989
  "cssnano": {
990
990
  "preset": [
991
991
  {
992
- "__await_evaluate__": "module.optionalImport('cssnano-preset-default').then((module) => module?.default)"
992
+ "__await_evaluate__": "(await module.optionalImport('cssnano-preset-default'))?.default"
993
993
  },
994
994
  "#: 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).",
995
995
  {
@@ -1140,7 +1140,7 @@
1140
1140
  "pre": []
1141
1141
  },
1142
1142
  "loader": {
1143
- "__await_evaluate__": "module.optionalImport('postcss-loader').then((result) => result ? 'postcss-loader' : null)"
1143
+ "__await_evaluate__": "(await module.optionalImport('postcss-loader')) ? 'postcss-loader' : null"
1144
1144
  },
1145
1145
  "options": {}
1146
1146
  },
@@ -272,8 +272,10 @@ if (htmlAvailable && plugins.HTML) pluginInstances.push(new HTMLTransformation({
272
272
  //// region context replacements
273
273
  for (const contextReplacement of module.replacements.context) pluginInstances.push(new ContextReplacementPlugin(...contextReplacement.map(value => {
274
274
  const evaluated = evaluate(value, {
275
- configuration,
276
- metaImport: import.meta
275
+ scope: {
276
+ configuration,
277
+ metaImport: import.meta
278
+ }
277
279
  });
278
280
  if (evaluated.error) throw new Error('Error occurred during processing given context ' + `replacement: ${evaluated.error}`);
279
281
  return evaluated.result;
@@ -375,9 +377,11 @@ const evaluateOrThrowOnError = (object, givenOptions = {}) => {
375
377
  };
376
378
  if (typeof object === 'string') {
377
379
  const evaluated = evaluate(object, {
378
- filePath: options.filePath,
379
- ...scope,
380
- type: options.type
380
+ scope: {
381
+ filePath: options.filePath,
382
+ ...scope,
383
+ type: options.type
384
+ }
381
385
  });
382
386
  if (evaluated.error) throw new Error('Error occurred during processing given expression: ' + evaluated.error);
383
387
  return evaluated.result;