weboptimizer 2.0.1513 → 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 +1 -1
- package/ejsLoader.js +4 -3
- package/package.json +1 -1
- package/webpackConfigurator.js +2 -2
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
|
|
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
|
|
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
|
-
},
|
|
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 (
|
|
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
package/webpackConfigurator.js
CHANGED
|
@@ -155,7 +155,7 @@ if (plugins.HTML) {
|
|
|
155
155
|
if (htmlAvailable && Object.prototype.hasOwnProperty.call(configuration, 'favicon') && plugins.Favicon && (0, _clientnode.isFileSync)([].concat(configuration.favicon.logo)[0])) pluginInstances.push(new plugins.Favicon(configuration.favicon));
|
|
156
156
|
//// endregion
|
|
157
157
|
//// region provide offline functionality
|
|
158
|
-
if (htmlAvailable &&
|
|
158
|
+
if (htmlAvailable && configuration.offline && Object.prototype.hasOwnProperty.call(plugins, 'Offline')) {
|
|
159
159
|
if (!['serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) for (var _i3 = 0, _Object$entries3 = Object.entries({
|
|
160
160
|
cascadingStyleSheet: 'css',
|
|
161
161
|
javaScript: 'js'
|
|
@@ -173,7 +173,7 @@ if (htmlAvailable && Object.prototype.hasOwnProperty.call(configuration, 'offlin
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
if (plugins.InjectManifest &&
|
|
176
|
+
if (plugins.InjectManifest && [].concat(configuration.offline.use).includes('injectionManifest')) pluginInstances.push(new plugins.InjectManifest((0, _clientnode.extend)(true, configuration.offline.common, configuration.offline.injectionManifest)));
|
|
177
177
|
if (plugins.GenerateServiceWorker && [].concat(configuration.offline.use).includes('generateServiceWorker')) pluginInstances.push(new plugins.GenerateServiceWorker((0, _clientnode.extend)(true, configuration.offline.common, configuration.offline.serviceWorker)));
|
|
178
178
|
}
|
|
179
179
|
//// endregion
|