weboptimizer 2.0.1548 → 2.0.1549
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/package.json +4 -4
- package/type.d.ts +2 -4
- package/webpackConfigurator.js +8 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1549",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"babel-loader": "^9.2.1",
|
|
102
102
|
"babel-plugin-transform-modern-regexp": "^0.0.6",
|
|
103
103
|
"babel-preset-minify": "^0.5.2",
|
|
104
|
-
"clientnode": "3.0.
|
|
104
|
+
"clientnode": "3.0.1252",
|
|
105
105
|
"ejs": "^3.1.10",
|
|
106
106
|
"exports-loader": "^5.0.0",
|
|
107
107
|
"extract-loader": "^5.1.0",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"@types/postcss-url": "^10.0.4",
|
|
134
134
|
"@types/webpack-env": "^1.18.5",
|
|
135
135
|
"@types/webpack-sources": "^3.2.3",
|
|
136
|
-
"@typescript-eslint/parser": "^8.
|
|
136
|
+
"@typescript-eslint/parser": "^8.18.0",
|
|
137
137
|
"css-loader": "^7.1.2",
|
|
138
138
|
"cssnano": "^7.0.6",
|
|
139
139
|
"documentation-website": "^1.0.341",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"stylelint": "^16.11.0",
|
|
162
162
|
"stylelint-config-standard": "^36.0.1",
|
|
163
163
|
"stylelint-config-standard-scss": "^14.0.0",
|
|
164
|
-
"typescript-eslint": "^8.
|
|
164
|
+
"typescript-eslint": "^8.18.0",
|
|
165
165
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
166
166
|
"workbox-webpack-plugin": "^7.3.0"
|
|
167
167
|
},
|
package/type.d.ts
CHANGED
|
@@ -375,7 +375,7 @@ export interface ResolvedConfiguration {
|
|
|
375
375
|
offline: (null | {
|
|
376
376
|
common: WorkboxBaseCommonOptions & WorkboxCommonOptions;
|
|
377
377
|
injectionManifest: WorkboxInjectManifestOptions;
|
|
378
|
-
|
|
378
|
+
generateServiceWorker: WorkboxGenerateSWOptions;
|
|
379
379
|
use: 'injectionManifest' | 'serviceWorker';
|
|
380
380
|
});
|
|
381
381
|
package: {
|
|
@@ -452,11 +452,9 @@ export interface WebpackAssets extends WebpackBaseAssets {
|
|
|
452
452
|
export type WebpackPlugin = webpackLibrary.AbstractLibraryPlugin<unknown> & Mapping<unknown>;
|
|
453
453
|
export type WebpackPlugins = Mapping<WebpackPlugin> & {
|
|
454
454
|
Favicon?: typeof FaviconWebpackPlugin;
|
|
455
|
-
GenerateServiceWorker?: typeof OfflinePlugin.GenerateSW;
|
|
456
455
|
HTML?: typeof HtmlWebpackPlugin;
|
|
457
456
|
ImageMinimizer?: typeof ImageMinimizerWebpackPlugin;
|
|
458
|
-
|
|
459
|
-
Offline?: {
|
|
457
|
+
offline?: {
|
|
460
458
|
GenerateSW: typeof OfflinePlugin.GenerateSW;
|
|
461
459
|
InjectManifest: typeof OfflinePlugin.InjectManifest;
|
|
462
460
|
};
|
package/webpackConfigurator.js
CHANGED
|
@@ -64,11 +64,11 @@ var updateRule = (_optionalRequire = optionalRequire('postcss-sprites/lib/core')
|
|
|
64
64
|
var postcssURL = optionalRequire('postcss-url');
|
|
65
65
|
/// endregion
|
|
66
66
|
var pluginNameResourceMapping = {
|
|
67
|
-
HTML: 'html-webpack-plugin',
|
|
68
|
-
MiniCSSExtract: 'mini-css-extract-plugin',
|
|
69
67
|
Favicon: 'favicons-webpack-plugin',
|
|
70
68
|
ImageMinimizer: 'image-minimizer-webpack-plugin',
|
|
71
|
-
|
|
69
|
+
HTML: 'html-webpack-plugin',
|
|
70
|
+
MiniCSSExtract: 'mini-css-extract-plugin',
|
|
71
|
+
offline: 'workbox-webpack-plugin',
|
|
72
72
|
Terser: 'terser-webpack-plugin'
|
|
73
73
|
};
|
|
74
74
|
var plugins = {};
|
|
@@ -79,10 +79,6 @@ for (var _i = 0, _Object$entries = Object.entries(pluginNameResourceMapping); _i
|
|
|
79
79
|
var plugin = optionalRequire(alias);
|
|
80
80
|
if (plugin) plugins[name] = plugin;else console.debug("Optional webpack plugin \"".concat(name, "\" not available."));
|
|
81
81
|
}
|
|
82
|
-
if (plugins.Offline) {
|
|
83
|
-
plugins.GenerateServiceWorker = plugins.Offline.GenerateSW;
|
|
84
|
-
plugins.InjectManifest = plugins.Offline.InjectManifest;
|
|
85
|
-
}
|
|
86
82
|
// endregion
|
|
87
83
|
var configuration = (0, _configurator["default"])();
|
|
88
84
|
var _module = configuration.module;
|
|
@@ -155,7 +151,7 @@ if (plugins.HTML) {
|
|
|
155
151
|
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
152
|
//// endregion
|
|
157
153
|
//// region provide offline functionality
|
|
158
|
-
if (htmlAvailable && configuration.offline && Object.prototype.hasOwnProperty.call(plugins, '
|
|
154
|
+
if (htmlAvailable && configuration.offline && Object.prototype.hasOwnProperty.call(plugins, 'offline')) {
|
|
159
155
|
if (!['serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) for (var _i3 = 0, _Object$entries3 = Object.entries({
|
|
160
156
|
cascadingStyleSheet: 'css',
|
|
161
157
|
javaScript: 'js'
|
|
@@ -173,8 +169,10 @@ if (htmlAvailable && configuration.offline && Object.prototype.hasOwnProperty.ca
|
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
171
|
}
|
|
176
|
-
if (plugins.
|
|
177
|
-
|
|
172
|
+
if (plugins.offline) {
|
|
173
|
+
if ([].concat(configuration.offline.use).includes('injectionManifest')) pluginInstances.push(new plugins.offline.InjectManifest((0, _clientnode.extend)(true, configuration.offline.common, configuration.offline.injectionManifest)));
|
|
174
|
+
if ([].concat(configuration.offline.use).includes('generateServiceWorker')) pluginInstances.push(new plugins.offline.GenerateSW((0, _clientnode.extend)(true, configuration.offline.common, configuration.offline.generateServiceWorker)));
|
|
175
|
+
}
|
|
178
176
|
}
|
|
179
177
|
//// endregion
|
|
180
178
|
//// region provide build environment
|