weboptimizer 2.0.1491 → 2.0.1493
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/browser.js +7 -5
- package/configurator.js +12 -12
- package/declarations.d.ts +3 -7
- package/ejsLoader.d.ts +1 -1
- package/ejsLoader.js +24 -23
- package/eslint.config.d.ts +2 -2
- package/eslint.config.mjs +40 -18
- package/helper.d.ts +242 -261
- package/helper.js +830 -894
- package/index.js +15 -13
- package/jestEnvironmentBrowser.js +3 -1
- package/jestSetup.js +1 -1
- package/package.json +23 -42
- package/plugins/HTMLTransformation.js +4 -3
- package/plugins/InPlaceAssetsIntoHTML.js +1 -1
- package/tsconfig.json +3 -1
- package/type.d.ts +14 -13
- package/webpackConfigurator.js +84 -74
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var _globAll = require("glob-all");
|
|
|
36
36
|
var _path = _interopRequireWildcard(require("path"));
|
|
37
37
|
var _rimraf = require("rimraf");
|
|
38
38
|
var _configurator = require("./configurator");
|
|
39
|
-
var _helper =
|
|
39
|
+
var _helper = require("./helper");
|
|
40
40
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
41
41
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
42
42
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
@@ -96,13 +96,13 @@ var main = function main(context) {
|
|
|
96
96
|
};
|
|
97
97
|
if (configuration.givenCommandLineArguments.length > 3 && (0, _clientnode.parseEncodedObject)(configuration.givenCommandLineArguments[configuration.givenCommandLineArguments.length - 1], configuration, 'configuration')) configuration.givenCommandLineArguments.pop();
|
|
98
98
|
count = 0;
|
|
99
|
-
filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
|
|
99
|
+
filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(String(count), ".json"));
|
|
100
100
|
case 15:
|
|
101
|
-
if (!
|
|
101
|
+
if (!(count < _clientnode.MAXIMAL_NUMBER_OF_ITERATIONS.value)) {
|
|
102
102
|
_context3.next = 24;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
|
-
filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(count, ".json"));
|
|
105
|
+
filePath = (0, _path.resolve)(configuration.path.context, ".dynamicConfiguration-".concat(String(count), ".json"));
|
|
106
106
|
_context3.next = 19;
|
|
107
107
|
return (0, _clientnode.isFile)(filePath);
|
|
108
108
|
case 19:
|
|
@@ -112,7 +112,7 @@ var main = function main(context) {
|
|
|
112
112
|
}
|
|
113
113
|
return _context3.abrupt("break", 24);
|
|
114
114
|
case 21:
|
|
115
|
-
count
|
|
115
|
+
count++;
|
|
116
116
|
_context3.next = 15;
|
|
117
117
|
break;
|
|
118
118
|
case 24:
|
|
@@ -151,7 +151,7 @@ var main = function main(context) {
|
|
|
151
151
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
152
152
|
while (1) switch (_context.prev = _context.next) {
|
|
153
153
|
case 0:
|
|
154
|
-
if (!_helper
|
|
154
|
+
if (!(0, _helper.isFilePathInLocation)(file.path, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
|
|
155
155
|
return (0, _path.resolve)(configuration.path.context, filePath);
|
|
156
156
|
}).filter(function (filePath) {
|
|
157
157
|
return !configuration.path.context.startsWith(filePath);
|
|
@@ -269,7 +269,7 @@ var main = function main(context) {
|
|
|
269
269
|
case 67:
|
|
270
270
|
// endregion
|
|
271
271
|
// region handle build
|
|
272
|
-
buildConfigurations = _helper
|
|
272
|
+
buildConfigurations = (0, _helper.resolveBuildConfigurationFilePaths)(configuration.buildContext.types, configuration.path.source.asset.base, configuration.path.ignore.concat(configuration.module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
|
|
273
273
|
return (0, _path.resolve)(configuration.path.context, filePath);
|
|
274
274
|
}).filter(function (filePath) {
|
|
275
275
|
return !configuration.path.context.startsWith(filePath);
|
|
@@ -295,13 +295,13 @@ var main = function main(context) {
|
|
|
295
295
|
try {
|
|
296
296
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
297
297
|
var moduleID = _step3.value;
|
|
298
|
-
var _filePath2 = _helper
|
|
298
|
+
var _filePath2 = (0, _helper.determineModuleFilePath)(moduleID, configuration.module.aliases, configuration.module.replacements.normal, {
|
|
299
299
|
file: configuration.extensions.file.internal
|
|
300
300
|
}, configuration.path.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);
|
|
301
301
|
var type = null;
|
|
302
|
-
if (_filePath2) type = _helper
|
|
303
|
-
if (typeof type === 'string' && configuration.buildContext.types
|
|
304
|
-
var _filePath3 = _helper
|
|
302
|
+
if (_filePath2) type = (0, _helper.determineAssetType)(_filePath2, configuration.buildContext.types, configuration.path);
|
|
303
|
+
if (typeof type === 'string' && Object.prototype.hasOwnProperty.call(configuration.buildContext.types, type)) {
|
|
304
|
+
var _filePath3 = (0, _helper.renderFilePathTemplate)((0, _helper.stripLoader)(configuration.files.compose.javaScript), {
|
|
305
305
|
'[name]': chunkName
|
|
306
306
|
});
|
|
307
307
|
/*
|
|
@@ -347,6 +347,8 @@ var main = function main(context) {
|
|
|
347
347
|
NOTE: Take current weboptimizer's dependencies into
|
|
348
348
|
account.
|
|
349
349
|
*/
|
|
350
|
+
if (!childProcessOptions.env) childProcessOptions.env = {};
|
|
351
|
+
if (typeof childProcessOptions.env.PATH !== 'string') childProcessOptions.env.PATH = '';
|
|
350
352
|
childProcessOptions.env.PATH += ":".concat(webOptimizerPath, "/node_modules/.bin");
|
|
351
353
|
var childProcess = (0, _child_process.spawn)(configuration.commandLine.build.command, commandLineArguments, childProcessOptions);
|
|
352
354
|
var copyAdditionalFilesAndTidyUp = function copyAdditionalFilesAndTidyUp() {
|
|
@@ -398,7 +400,7 @@ var main = function main(context) {
|
|
|
398
400
|
}
|
|
399
401
|
// Perform all file specific preprocessing stuff.
|
|
400
402
|
testModuleFilePaths = [];
|
|
401
|
-
if ((0, _clientnode.isPlainObject)(configuration['test:browser'].injection) && configuration['test:browser'].injection.entry) testModuleFilePaths = _helper
|
|
403
|
+
if ((0, _clientnode.isPlainObject)(configuration['test:browser'].injection) && configuration['test:browser'].injection.entry) testModuleFilePaths = (0, _helper.determineModuleLocations)(configuration['test:browser'].injection.entry, configuration.module.aliases, configuration.module.replacements.normal, {
|
|
402
404
|
file: configuration.extensions.file.internal
|
|
403
405
|
}, configuration.path.context, configuration.path.source.asset.base, configuration.path.ignore).filePaths;
|
|
404
406
|
_iterator7 = _createForOfIteratorHelper(buildConfigurations);
|
|
@@ -442,7 +444,7 @@ var main = function main(context) {
|
|
|
442
444
|
return [(0, _clientnode.handleChildProcess)((0, _child_process.exec)(evaluated.result, _objectSpread({
|
|
443
445
|
encoding: configuration.encoding
|
|
444
446
|
}, processOptions), function (error) {
|
|
445
|
-
|
|
447
|
+
if (error) reject(error);else resolve({
|
|
446
448
|
reason: 'Finished.',
|
|
447
449
|
parameters: []
|
|
448
450
|
});
|
|
@@ -38,7 +38,9 @@ var BrowserEnvironment = exports.BrowserEnvironment = /*#__PURE__*/function () {
|
|
|
38
38
|
}
|
|
39
39
|
}, {
|
|
40
40
|
key: "teardown",
|
|
41
|
-
value: function teardown() {
|
|
41
|
+
value: function teardown() {
|
|
42
|
+
// Stub method.
|
|
43
|
+
}
|
|
42
44
|
}, {
|
|
43
45
|
key: "runScript",
|
|
44
46
|
value: function runScript() {
|
package/jestSetup.js
CHANGED
|
@@ -22,6 +22,6 @@ _clientnode.globalContext.TextEncoder = _util.TextEncoder;
|
|
|
22
22
|
_clientnode.globalContext.TextDecoder = _util.TextDecoder;
|
|
23
23
|
try {
|
|
24
24
|
if (eval('require')('jest-canvas-mock')) console.info('Canvas mocking module loaded.');
|
|
25
|
-
} catch (
|
|
25
|
+
} catch (_error) {
|
|
26
26
|
// Do nothing.
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1493",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"clear": "rimraf --glob apiDocumentation browser.d.ts configurator.d.ts ejsLoader.d.ts eslint.config.d.ts helper.d.ts index.d.ts jestSetup.d.ts jestEnvironmentBrowser.d.ts 'plugins/*.d.ts' 'plugins/*.js' stylelintConfigurator.d.ts 'test/*.js' 'test/*.compiled.*' 'test/*.d.ts' 'test/**/yarn.lock' 'test/**/node_modules' type.d.ts webpackConfigurator.d.ts '*.compiled.*' '*.compiled' '*.html' '*.js' '*.log' '*.mjs' node_modules/weboptimizer .coverage .nyc_output",
|
|
77
77
|
"document": "yarn build:plain && jsdoc --package ./package.json --readme ./readme.md --destination apiDocumentation *.js",
|
|
78
78
|
"lint": "yarn build:lint && yarn lint:base",
|
|
79
|
-
"lint:base": "eslint *.ts */*.ts test/*/*.ts",
|
|
79
|
+
"lint:base": "eslint --no-warn-ignored *.ts */*.ts test/*/*.ts",
|
|
80
80
|
"prepare": "yarn build",
|
|
81
81
|
"prettify": "yarn lint:base --fix || true",
|
|
82
82
|
"test": "yarn build:test && jest --config ./jest.json --noStackTrace --root-dir './' --test-regex '/test/.+\\\\.js$' test/browser.js test/configurator.js test/helper.js test/ejsLoader.js test/stylelintConfigurator.js test/index.js test/webpackConfigurator.js",
|
|
@@ -89,77 +89,77 @@
|
|
|
89
89
|
},
|
|
90
90
|
"runkitExample": "require('@babel/runtime/package.json')\n\nconst {default: main} = require('weboptimizer')\n\nawait main('./', './', ['clear'])",
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@babel/core": "^7.
|
|
92
|
+
"@babel/core": "^7.25.2",
|
|
93
93
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
94
94
|
"@babel/plugin-proposal-decorators": "^7.24.7",
|
|
95
95
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
96
96
|
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
97
|
-
"@babel/preset-env": "^7.
|
|
97
|
+
"@babel/preset-env": "^7.25.3",
|
|
98
98
|
"@babel/preset-typescript": "^7.24.7",
|
|
99
|
-
"@babel/runtime": "^7.
|
|
99
|
+
"@babel/runtime": "^7.25.0",
|
|
100
100
|
"babel-loader": "^9.1.3",
|
|
101
101
|
"babel-plugin-transform-modern-regexp": "^0.0.6",
|
|
102
102
|
"babel-preset-minify": "^0.5.2",
|
|
103
|
-
"clientnode": "3.0.
|
|
103
|
+
"clientnode": "3.0.1169",
|
|
104
104
|
"ejs": "^3.1.10",
|
|
105
105
|
"exports-loader": "^5.0.0",
|
|
106
106
|
"extract-loader": "^5.1.0",
|
|
107
107
|
"glob-all": "^3.3.1",
|
|
108
|
-
"html-loader": "^5.
|
|
108
|
+
"html-loader": "^5.1.0",
|
|
109
109
|
"html-minifier": "^4.0.0",
|
|
110
110
|
"html-webpack-plugin": "^5.6.0",
|
|
111
111
|
"imports-loader": "^5.0.0",
|
|
112
112
|
"jest-environment-jsdom": "^29.7.0",
|
|
113
113
|
"rimraf": "^6.0.1",
|
|
114
114
|
"script-loader": "^0.7.2",
|
|
115
|
-
"typescript": "^5.5.
|
|
115
|
+
"typescript": "^5.5.4",
|
|
116
116
|
"webpack": "^5.93.0",
|
|
117
117
|
"webpack-cli": "^5.1.4",
|
|
118
118
|
"webpack-sources": "^3.2.3"
|
|
119
119
|
},
|
|
120
120
|
"devDependencies": {
|
|
121
121
|
"@babel/cli": "^7.24.8",
|
|
122
|
-
"@babel/eslint-parser": "^7.
|
|
122
|
+
"@babel/eslint-parser": "^7.25.1",
|
|
123
|
+
"@stylistic/eslint-plugin": "^2.6.1",
|
|
123
124
|
"@types/ejs": "^3.1.5",
|
|
124
|
-
"@types/eslint": "^
|
|
125
|
+
"@types/eslint": "^9.6.0",
|
|
125
126
|
"@types/html-minifier": "^4.0.5",
|
|
126
127
|
"@types/html-minifier-terser": "^7.0.2",
|
|
127
128
|
"@types/imagemin": "^9.0.0",
|
|
128
|
-
"@types/node": "^
|
|
129
|
+
"@types/node": "^22.1.0",
|
|
129
130
|
"@types/postcss-import": "^14.0.3",
|
|
130
131
|
"@types/postcss-url": "^10.0.4",
|
|
131
132
|
"@types/webpack-env": "^1.18.5",
|
|
132
133
|
"@types/webpack-sources": "^3.2.3",
|
|
133
|
-
"@typescript-eslint/
|
|
134
|
-
"@typescript-eslint/parser": "^7.16.1",
|
|
134
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
135
135
|
"css-loader": "^7.1.2",
|
|
136
136
|
"cssnano": "^7.0.4",
|
|
137
|
-
"documentation-website": "^1.0.
|
|
138
|
-
"eslint": "^9.
|
|
137
|
+
"documentation-website": "^1.0.330",
|
|
138
|
+
"eslint": "^9.8.0",
|
|
139
139
|
"eslint-config-google": "^0.14.0",
|
|
140
|
-
"eslint-plugin-jsdoc": "^
|
|
140
|
+
"eslint-plugin-jsdoc": "^50.0.0",
|
|
141
141
|
"favicons": "^7.2.0",
|
|
142
142
|
"favicons-webpack-plugin": "^6.0.1",
|
|
143
|
-
"globals": "^15.
|
|
144
|
-
"image-minimizer-webpack-plugin": "^4.0
|
|
143
|
+
"globals": "^15.9.0",
|
|
144
|
+
"image-minimizer-webpack-plugin": "^4.1.0",
|
|
145
145
|
"jest": "^29.7.0",
|
|
146
146
|
"jsdoc": "^4.0.3",
|
|
147
147
|
"mini-css-extract-plugin": "^2.9.0",
|
|
148
148
|
"mkdirp": "^3.0.1",
|
|
149
149
|
"node-fetch": "^3.3.2",
|
|
150
|
-
"postcss": "^8.4.
|
|
150
|
+
"postcss": "^8.4.41",
|
|
151
151
|
"postcss-fontpath": "^1.0.0",
|
|
152
152
|
"postcss-import": "^16.1.0",
|
|
153
153
|
"postcss-loader": "^8.1.1",
|
|
154
|
-
"postcss-preset-env": "^
|
|
154
|
+
"postcss-preset-env": "^10.0.0",
|
|
155
155
|
"postcss-sprites": "^4.2.1",
|
|
156
156
|
"postcss-url": "^10.1.3",
|
|
157
157
|
"shx": "^0.3.4",
|
|
158
158
|
"style-loader": "^4.0.0",
|
|
159
|
-
"stylelint": "^16.
|
|
159
|
+
"stylelint": "^16.8.1",
|
|
160
160
|
"stylelint-config-standard": "^36.0.1",
|
|
161
161
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
162
|
-
"typescript-eslint": "^
|
|
162
|
+
"typescript-eslint": "^8.0.1",
|
|
163
163
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
164
164
|
"workbox-webpack-plugin": "^7.1.0"
|
|
165
165
|
},
|
|
@@ -482,26 +482,7 @@
|
|
|
482
482
|
{
|
|
483
483
|
"__evaluate__": "filesystem.isFileSync(path.resolve(currentPath, 'tsconfig.json')) ? '--parser-options=project:tsconfig.json' : ''"
|
|
484
484
|
},
|
|
485
|
-
"--
|
|
486
|
-
"'**/.git/*'",
|
|
487
|
-
"--ignore-pattern",
|
|
488
|
-
"'**/.cache/*'",
|
|
489
|
-
"--ignore-pattern",
|
|
490
|
-
"'**/.config/*'",
|
|
491
|
-
"--ignore-pattern",
|
|
492
|
-
"'**/.npm/*'",
|
|
493
|
-
"--ignore-pattern",
|
|
494
|
-
"'**/log/*'",
|
|
495
|
-
"--ignore-pattern",
|
|
496
|
-
"'**/node_modules/*'",
|
|
497
|
-
"--ignore-pattern",
|
|
498
|
-
"'**/backup/*'",
|
|
499
|
-
"--ignore-pattern",
|
|
500
|
-
"'**/exclude/*'",
|
|
501
|
-
"--ignore-pattern",
|
|
502
|
-
"'**/plugins/*'",
|
|
503
|
-
"--ignore-pattern",
|
|
504
|
-
"'*.d.ts'",
|
|
485
|
+
"--no-warn-ignored",
|
|
505
486
|
"'**/*.{jsx,ts,tsx}'"
|
|
506
487
|
],
|
|
507
488
|
"command": "eslint",
|
|
@@ -62,7 +62,7 @@ var HTMLTransformation = exports.HTMLTransformation = /*#__PURE__*/function () {
|
|
|
62
62
|
unexpected escape sequences in resulting html.
|
|
63
63
|
*/
|
|
64
64
|
dom = new _jsdom.JSDOM(data.html.replace(/<%/g, '##+#+#+##').replace(/%>/g, '##-#-#-##'));
|
|
65
|
-
} catch (
|
|
65
|
+
} catch (_error) {
|
|
66
66
|
return data;
|
|
67
67
|
}
|
|
68
68
|
var linkables = {
|
|
@@ -80,7 +80,8 @@ var HTMLTransformation = exports.HTMLTransformation = /*#__PURE__*/function () {
|
|
|
80
80
|
necessary to match the generated request strings in offline
|
|
81
81
|
plugin.
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
var value = domNode.getAttribute(attributeName);
|
|
84
|
+
if (value) domNode.setAttribute(attributeName, value.replace(new RegExp("(\\?".concat(this.options.hashAlgorithm, "=[^&]+).*$")), '$1'));
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
// NOTE: We have to restore template delimiter and style contents.
|
|
@@ -101,7 +102,7 @@ var HTMLTransformation = exports.HTMLTransformation = /*#__PURE__*/function () {
|
|
|
101
102
|
var _loaderConfiguration$;
|
|
102
103
|
var loaderConfiguration = _step2.value;
|
|
103
104
|
if ((_loaderConfiguration$ = loaderConfiguration.options) !== null && _loaderConfiguration$ !== void 0 && _loaderConfiguration$.compileSteps && typeof loaderConfiguration.options.compileSteps === 'number') data.html = _ejsLoader["default"].bind({
|
|
104
|
-
query: (0, _clientnode.extend)(true, (0, _clientnode.copy)(loaderConfiguration.options)
|
|
105
|
+
query: (0, _clientnode.extend)(true, Object.prototype.hasOwnProperty.call(loaderConfiguration, 'options') ? (0, _clientnode.copy)(loaderConfiguration.options) : {}, htmlFileSpecification.template.postCompileOptions)
|
|
105
106
|
})(data.html);
|
|
106
107
|
}
|
|
107
108
|
} catch (err) {
|
|
@@ -56,7 +56,7 @@ var InPlaceAssetsIntoHTML = exports.InPlaceAssetsIntoHTML = /*#__PURE__*/functio
|
|
|
56
56
|
}
|
|
57
57
|
if (!(url && typeof url === 'string')) return tag;
|
|
58
58
|
var name = publicPath ? url.replace(publicPath, '') : url;
|
|
59
|
-
if (compilation.assets
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(compilation.assets, name) && settings && settings[type] && [].concat(settings[type]).some(function (pattern) {
|
|
60
60
|
return new RegExp(pattern).test(name);
|
|
61
61
|
})) {
|
|
62
62
|
var newAttributes = _objectSpread({}, tag.attributes);
|
package/tsconfig.json
CHANGED
|
@@ -23,11 +23,13 @@
|
|
|
23
23
|
"target": "esnext"
|
|
24
24
|
},
|
|
25
25
|
"exclude": [
|
|
26
|
-
"**/exclude/*"
|
|
26
|
+
"**/exclude/*",
|
|
27
|
+
"test/**/*.d.ts"
|
|
27
28
|
],
|
|
28
29
|
"include": [
|
|
29
30
|
"*.ts", "*.tsx",
|
|
30
31
|
"*/*.ts", "*/*.tsx",
|
|
32
|
+
"*/declarations.d.ts",
|
|
31
33
|
|
|
32
34
|
"assets/src/**/*.ts", "/assets/src/**/*.tsx",
|
|
33
35
|
"assets/source/**/*.ts", "/assets/source/**/*.tsx",
|
package/type.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { AnyFunction, Encoding, Mapping, PlainObject, SecondParameter } from 'clientnode';
|
|
2
|
-
import FaviconWebpackPlugin from 'favicons-webpack-plugin';
|
|
2
|
+
import type FaviconWebpackPlugin from 'favicons-webpack-plugin';
|
|
3
3
|
import { FaviconWebpackPlugionOptions as FaviconWebpackPluginOptions } from 'favicons-webpack-plugin/src/options';
|
|
4
4
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
5
|
-
import ImageMinimizerWebpackPlugin
|
|
5
|
+
import type ImageMinimizerWebpackPlugin from 'image-minimizer-webpack-plugin';
|
|
6
|
+
import { PluginOptions as ImageMinimizerOptions } from 'image-minimizer-webpack-plugin';
|
|
6
7
|
import { JSDOM } from 'jsdom';
|
|
7
|
-
import MiniCSSExtractPlugin from 'mini-css-extract-plugin';
|
|
8
|
-
import TerserWebpackPlugin from 'terser-webpack-plugin';
|
|
8
|
+
import type MiniCSSExtractPlugin from 'mini-css-extract-plugin';
|
|
9
|
+
import type TerserWebpackPlugin from 'terser-webpack-plugin';
|
|
9
10
|
import { DefinePlugin as WebpackDefinePlugin, Configuration as BaseWebpackConfiguration, IgnorePlugin as WebpackIgnorePlugin, library as webpackLibrary, ModuleOptions as WebpackModuleOptions, RuleSetRule as WebpackRuleSetRule, RuleSetUseItem as WebpackRuleSetUseItem, WebpackOptionsNormalized } from 'webpack';
|
|
10
11
|
import { WebpackPartial as WorkboxBaseCommonOptions, BasePartial as WorkboxCommonOptions, WebpackGenerateSWOptions as WorkboxGenerateSWOptions, WebpackInjectManifestOptions as WorkboxInjectManifestOptions } from 'workbox-build';
|
|
11
|
-
import OfflinePlugin from 'workbox-webpack-plugin';
|
|
12
|
+
import type OfflinePlugin from 'workbox-webpack-plugin';
|
|
12
13
|
export interface Browser {
|
|
13
14
|
debug: boolean;
|
|
14
15
|
domContentLoaded: boolean;
|
|
@@ -39,7 +40,7 @@ export interface RedundantRequest {
|
|
|
39
40
|
path: string;
|
|
40
41
|
version: string;
|
|
41
42
|
}
|
|
42
|
-
export type ExternalAliases = Mapping<Mapping | string | ((_request: string, _key: string) => string)>;
|
|
43
|
+
export type ExternalAliases = Mapping<Mapping | null | string | ((_request: string, _key: string) => string)>;
|
|
43
44
|
export type GivenInjection = AnyFunction | string | Array<string> | Mapping<string | Array<string>>;
|
|
44
45
|
export type NormalizedGivenInjection = Mapping<Array<string>>;
|
|
45
46
|
export interface GivenInjectionConfiguration {
|
|
@@ -170,7 +171,7 @@ export interface WebpackLoaderConfiguration {
|
|
|
170
171
|
}
|
|
171
172
|
export type WebpackLoaderIndicator = WebpackRuleSetRule['include'];
|
|
172
173
|
export interface Command {
|
|
173
|
-
arguments
|
|
174
|
+
arguments?: Array<string>;
|
|
174
175
|
command: string;
|
|
175
176
|
indicator?: string;
|
|
176
177
|
}
|
|
@@ -328,7 +329,7 @@ export interface ResolvedConfiguration {
|
|
|
328
329
|
};
|
|
329
330
|
module?: PlainObject;
|
|
330
331
|
};
|
|
331
|
-
cssnano
|
|
332
|
+
cssnano?: PlainObject;
|
|
332
333
|
data: ResourceLoaderConfiguration;
|
|
333
334
|
font: {
|
|
334
335
|
eot: ResourceLoaderConfiguration;
|
|
@@ -339,7 +340,7 @@ export interface ResolvedConfiguration {
|
|
|
339
340
|
htmlMinifier?: PlainObject;
|
|
340
341
|
image: {
|
|
341
342
|
content: ImageMinimizerOptions<unknown, unknown>;
|
|
342
|
-
exclude: string;
|
|
343
|
+
exclude: null | string;
|
|
343
344
|
loader: Array<string>;
|
|
344
345
|
};
|
|
345
346
|
};
|
|
@@ -442,8 +443,8 @@ export interface WebpackBaseAssets {
|
|
|
442
443
|
plugin: HtmlWebpackPlugin;
|
|
443
444
|
}
|
|
444
445
|
export interface WebpackAssets extends WebpackBaseAssets {
|
|
445
|
-
bodyTags: HtmlWebpackPlugin.HtmlTagObject
|
|
446
|
-
headTags: HtmlWebpackPlugin.HtmlTagObject
|
|
446
|
+
bodyTags: Array<HtmlWebpackPlugin.HtmlTagObject>;
|
|
447
|
+
headTags: Array<HtmlWebpackPlugin.HtmlTagObject>;
|
|
447
448
|
outputName: string;
|
|
448
449
|
publicPath: string;
|
|
449
450
|
plugin: HtmlWebpackPlugin;
|
|
@@ -472,8 +473,8 @@ export type WebpackExtendedResolveData = WebpackResolveData & {
|
|
|
472
473
|
};
|
|
473
474
|
};
|
|
474
475
|
export interface HTMLWebpackPluginAssetTagGroupsData {
|
|
475
|
-
bodyTags: HtmlWebpackPlugin.HtmlTagObject
|
|
476
|
-
headTags: HtmlWebpackPlugin.HtmlTagObject
|
|
476
|
+
bodyTags: Array<HtmlWebpackPlugin.HtmlTagObject>;
|
|
477
|
+
headTags: Array<HtmlWebpackPlugin.HtmlTagObject>;
|
|
477
478
|
outputName: string;
|
|
478
479
|
plugin: HtmlWebpackPlugin;
|
|
479
480
|
}
|