weboptimizer 2.0.1461 → 2.0.1463
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 +3 -3
- package/configurator.js +3 -3
- package/eslint.config.mjs +107 -0
- package/helper.js +3 -3
- package/index.js +3 -3
- package/package.json +27 -29
- package/plugins/HTMLTransformation.js +3 -3
- package/webpackConfigurator.js +3 -3
package/browser.js
CHANGED
|
@@ -26,9 +26,9 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
26
26
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
27
27
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
28
28
|
var _clientnode = _interopRequireWildcard(require("clientnode"));
|
|
29
|
-
function _createForOfIteratorHelper(
|
|
30
|
-
function _unsupportedIterableToArray(
|
|
31
|
-
function _arrayLikeToArray(
|
|
29
|
+
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; } } }; }
|
|
30
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
31
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
32
32
|
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); }
|
|
33
33
|
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; }
|
|
34
34
|
// endregion
|
package/configurator.js
CHANGED
|
@@ -32,9 +32,9 @@ var _package = _interopRequireWildcard(require("./package.json"));
|
|
|
32
32
|
var _type4 = require("./type");
|
|
33
33
|
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); }
|
|
34
34
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(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; }
|
|
35
|
-
function _createForOfIteratorHelper(
|
|
36
|
-
function _unsupportedIterableToArray(
|
|
37
|
-
function _arrayLikeToArray(
|
|
35
|
+
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; } } }; }
|
|
36
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
37
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
38
38
|
// endregion
|
|
39
39
|
var loadedConfiguration = exports.loadedConfiguration = null;
|
|
40
40
|
/**
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import globals from 'globals';
|
|
2
|
+
import google from 'eslint-config-google';
|
|
3
|
+
import jsdoc from 'eslint-plugin-jsdoc';
|
|
4
|
+
import js from '@eslint/js';
|
|
5
|
+
import typescript from 'typescript-eslint';
|
|
6
|
+
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
|
|
7
|
+
import typescriptParser from '@typescript-eslint/parser';
|
|
8
|
+
|
|
9
|
+
// Remove unsported rules.
|
|
10
|
+
const unsuportedRules = ['require-jsdoc', 'valid-jsdoc'];
|
|
11
|
+
const googleRules = Object.keys(google.rules).filter(key => !unsuportedRules.includes(key)).reduce((object, key) => ({
|
|
12
|
+
...object,
|
|
13
|
+
[key]: google.rules[key]
|
|
14
|
+
}), {});
|
|
15
|
+
export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc.configs['flat/recommended'], {
|
|
16
|
+
languageOptions: {
|
|
17
|
+
ecmaVersion: 'latest',
|
|
18
|
+
globals: {
|
|
19
|
+
...globals.browser,
|
|
20
|
+
...globals.node,
|
|
21
|
+
...globals.jest
|
|
22
|
+
},
|
|
23
|
+
parser: typescriptParser,
|
|
24
|
+
parserOptions: {
|
|
25
|
+
ecmaFeatures: {
|
|
26
|
+
jsx: true
|
|
27
|
+
},
|
|
28
|
+
impliedStrict: true,
|
|
29
|
+
project: './tsconfig.json'
|
|
30
|
+
},
|
|
31
|
+
sourceType: 'module'
|
|
32
|
+
},
|
|
33
|
+
ignores: ['**/exclude/*', '*.compiled.*', '*.d.ts', '**/*.d.ts', '*.js', '**/*.js'],
|
|
34
|
+
plugins: {
|
|
35
|
+
jsdoc,
|
|
36
|
+
'@typescript-eslint': typescriptPlugin
|
|
37
|
+
},
|
|
38
|
+
rules: {
|
|
39
|
+
...googleRules,
|
|
40
|
+
...typescriptPlugin.configs.recommended.rules,
|
|
41
|
+
'@typescript-eslint/no-implied-eval': 'error',
|
|
42
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
43
|
+
'@typescript-eslint/no-this-alias': ['error', {
|
|
44
|
+
allowedNames: ['self']
|
|
45
|
+
}],
|
|
46
|
+
'@typescript-eslint/no-unused-vars': ['error', {
|
|
47
|
+
argsIgnorePattern: '^_',
|
|
48
|
+
varsIgnorePattern: '^_'
|
|
49
|
+
}],
|
|
50
|
+
'@typescript-eslint/type-annotation-spacing': ['error', {
|
|
51
|
+
after: false,
|
|
52
|
+
before: false,
|
|
53
|
+
overrides: {
|
|
54
|
+
arrow: {
|
|
55
|
+
after: true,
|
|
56
|
+
before: true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}],
|
|
60
|
+
'jsdoc/check-param-names': 'error',
|
|
61
|
+
'jsdoc/check-tag-names': 'error',
|
|
62
|
+
'jsdoc/require-description-complete-sentence': 'error',
|
|
63
|
+
'jsdoc/require-hyphen-before-param-description': 'error',
|
|
64
|
+
'jsdoc/require-param': 'error',
|
|
65
|
+
'jsdoc/require-param-description': 'error',
|
|
66
|
+
'jsdoc/require-param-type': 'off',
|
|
67
|
+
'jsdoc/require-returns-description': 'error',
|
|
68
|
+
'jsdoc/require-returns-type': 'off',
|
|
69
|
+
'jsdoc/tag-lines': ['error', 'never'],
|
|
70
|
+
'arrow-parens': ['error', 'always'],
|
|
71
|
+
'block-scoped-var': 'off',
|
|
72
|
+
camelcase: ['error', {
|
|
73
|
+
properties: 'always'
|
|
74
|
+
}],
|
|
75
|
+
'comma-dangle': ['error', 'never'],
|
|
76
|
+
curly: ['error', 'multi'],
|
|
77
|
+
indent: ['error', 4, {
|
|
78
|
+
ignoreComments: true
|
|
79
|
+
}],
|
|
80
|
+
'max-nested-callbacks': ['error', 10],
|
|
81
|
+
'new-cap': 'off',
|
|
82
|
+
'no-invalid-this': 'off',
|
|
83
|
+
'no-unused-vars': ['off', {
|
|
84
|
+
argsIgnorePattern: '^_',
|
|
85
|
+
varsIgnorePattern: '^_'
|
|
86
|
+
}],
|
|
87
|
+
'no-constant-condition': 'off',
|
|
88
|
+
'no-new-func': 'off',
|
|
89
|
+
'no-new-wrappers': 'off',
|
|
90
|
+
'quote-props': ['error', 'as-needed', {
|
|
91
|
+
numbers: true
|
|
92
|
+
}],
|
|
93
|
+
semi: ['error', 'never'],
|
|
94
|
+
'space-before-function-paren': ['error', {
|
|
95
|
+
anonymous: 'never',
|
|
96
|
+
asyncArrow: 'always',
|
|
97
|
+
named: 'never'
|
|
98
|
+
}],
|
|
99
|
+
'spaced-comment': ['error', 'always', {
|
|
100
|
+
line: {
|
|
101
|
+
exceptions: ['/usr/bin/env node']
|
|
102
|
+
},
|
|
103
|
+
markers: ['/', '//', '///']
|
|
104
|
+
}],
|
|
105
|
+
'space-infix-ops': 'off'
|
|
106
|
+
}
|
|
107
|
+
}];
|
package/helper.js
CHANGED
|
@@ -33,9 +33,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
33
33
|
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; }
|
|
34
34
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
35
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
|
-
function _createForOfIteratorHelper(
|
|
37
|
-
function _unsupportedIterableToArray(
|
|
38
|
-
function _arrayLikeToArray(
|
|
36
|
+
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; } } }; }
|
|
37
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
38
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
39
39
|
// endregion
|
|
40
40
|
// region constants
|
|
41
41
|
var KNOWN_FILE_EXTENSIONS = exports.KNOWN_FILE_EXTENSIONS = ['js', 'ts', 'json', 'css', 'eot', 'gif', 'html', 'ico', 'jpg', 'png', 'ejs', 'svg', 'ttf', 'woff', '.woff2'];
|
package/index.js
CHANGED
|
@@ -39,9 +39,9 @@ var _configurator = require("./configurator");
|
|
|
39
39
|
var _helper = _interopRequireDefault(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
|
-
function _createForOfIteratorHelper(
|
|
43
|
-
function _unsupportedIterableToArray(
|
|
44
|
-
function _arrayLikeToArray(
|
|
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; } } }; }
|
|
43
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
44
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
45
45
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
46
46
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
47
47
|
// endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1463",
|
|
4
4
|
"description": "A generic web optimizer, (module) bundler and development environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webpack",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ejsLoader.d.ts",
|
|
34
34
|
"ejsLoader.js",
|
|
35
35
|
"eslint.config.d.ts",
|
|
36
|
-
"eslint.config.
|
|
36
|
+
"eslint.config.mjs",
|
|
37
37
|
"helper.d.ts",
|
|
38
38
|
"helper.js",
|
|
39
39
|
"index.d.ts",
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
"url": "https://github.com/thaibault/weboptimizer.git"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"build": "yarn build:types; yarn build:plain",
|
|
68
|
-
"build:lint": "babel --extensions '.ts' --plugins @babel/plugin-syntax-top-level-await,babel-plugin-transform-modern-regexp --presets
|
|
67
|
+
"build": "yarn build:types; yarn build:lint; yarn build:plain",
|
|
68
|
+
"build:lint": " babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,babel-plugin-transform-modern-regexp --presets @babel/preset-typescript --out-file eslint.config.mjs eslint.config.ts",
|
|
69
69
|
"build:plain": "command=\"babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime,babel-plugin-transform-modern-regexp --presets @babel/preset-env,@babel/preset-typescript --out-file\" && $command browser.js browser.ts && $command configurator.js configurator.ts && $command ejsLoader.js ejsLoader.ts && $command helper.js helper.ts && $command index.js index.ts && $command jestEnvironmentBrowser.js jestEnvironmentBrowser.ts && $command jestSetup.js jestSetup.ts && $command plugins/HTMLTransformation.js plugins/HTMLTransformation.ts && $command plugins/InPlaceAssetsIntoHTML.js plugins/InPlaceAssetsIntoHTML.ts && $command stylelintConfigurator.js stylelintConfigurator.ts && $command type.js type.ts && $command webpackConfigurator.js webpackConfigurator.ts && shx chmod +x index.js && shx sed -i 's/(#!\\\\/usr\\\\/bin\\\\/env )babel-(node)/$1$2/' index.js 1>/dev/null",
|
|
70
70
|
"build:test": " yarn clear && yarn build:plain && command='babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-root ../ --out-file' && cd test/simple && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && rimraf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/ && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
|
|
71
71
|
"build:test:source-map": "yarn clear && yarn build:plain && command='babel --extensions '.ts' --plugins @babel/plugin-proposal-class-properties,@babel/plugin-syntax-top-level-await,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-maps inline --source-root ../ --out-file' && cd test/simple && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && rimraf node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && shx mkdir -p node_modules/weboptimizer test/simple/node_modules/weboptimizer test/scss/node_modules/weboptimizer && copyCommand='shx cp -r plugins *.ts *.js *.json *.ejs' && $copyCommand node_modules/weboptimizer/ && $copyCommand test/simple/node_modules/weboptimizer/ && $copyCommand test/scss/node_modules/weboptimizer/ && $command test/browser.js test/browser.ts && $command test/configurator.js test/configurator.ts && $command test/helper.js test/helper.ts && $command test/ejsLoader.js test/ejsLoader.ts && $command test/stylelintConfigurator.js test/stylelintConfigurator.ts && $command test/index.js test/index.ts && $command test/webpackConfigurator.js test/webpackConfigurator.ts",
|
|
72
72
|
"build:types": "tsc --declaration --emitDeclarationOnly",
|
|
73
73
|
"check": "yarn check:types; yarn lint",
|
|
74
74
|
"check:types": "tsc --noEmit",
|
|
75
|
-
"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' 'test/**/yarn.lock' 'test/**/node_modules' type.d.ts webpackConfigurator.d.ts '*.
|
|
75
|
+
"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' 'test/**/yarn.lock' 'test/**/node_modules' type.d.ts webpackConfigurator.d.ts '*.compiled.*' '*.compiled' '*.html' '*.js' '*.log' '*.mjs' node_modules/weboptimizer .coverage .nyc_output",
|
|
76
76
|
"document": "yarn build:plain && jsdoc --package ./package.json --readme ./readme.md --destination apiDocumentation *.js",
|
|
77
77
|
"lint": "yarn build:lint && yarn lint:base",
|
|
78
78
|
"lint:base": "eslint *.ts */*.ts test/*/*.ts",
|
|
@@ -88,14 +88,14 @@
|
|
|
88
88
|
},
|
|
89
89
|
"runkitExample": "require('@babel/runtime/package.json')\n\nconst {default: main} = require('weboptimizer')\n\nawait main('./', './', ['clear'])",
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@babel/core": "^7.24.
|
|
91
|
+
"@babel/core": "^7.24.7",
|
|
92
92
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
93
|
-
"@babel/plugin-proposal-decorators": "^7.24.
|
|
93
|
+
"@babel/plugin-proposal-decorators": "^7.24.7",
|
|
94
94
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
95
|
-
"@babel/plugin-transform-runtime": "^7.24.
|
|
96
|
-
"@babel/preset-env": "^7.24.
|
|
97
|
-
"@babel/preset-typescript": "^7.24.
|
|
98
|
-
"@babel/runtime": "^7.24.
|
|
95
|
+
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
96
|
+
"@babel/preset-env": "^7.24.7",
|
|
97
|
+
"@babel/preset-typescript": "^7.24.7",
|
|
98
|
+
"@babel/runtime": "^7.24.7",
|
|
99
99
|
"babel-loader": "^9.1.3",
|
|
100
100
|
"babel-plugin-transform-modern-regexp": "^0.0.6",
|
|
101
101
|
"babel-preset-minify": "^0.5.2",
|
|
@@ -117,30 +117,30 @@
|
|
|
117
117
|
"webpack-sources": "^3.2.3"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@babel/cli": "^7.24.
|
|
121
|
-
"@babel/eslint-parser": "^7.24.
|
|
120
|
+
"@babel/cli": "^7.24.7",
|
|
121
|
+
"@babel/eslint-parser": "^7.24.7",
|
|
122
122
|
"@types/ejs": "^3.1.5",
|
|
123
123
|
"@types/eslint": "^8.56.10",
|
|
124
124
|
"@types/html-minifier": "^4.0.5",
|
|
125
125
|
"@types/html-minifier-terser": "^7.0.2",
|
|
126
|
-
"@types/imagemin": "^
|
|
127
|
-
"@types/node": "^20.
|
|
126
|
+
"@types/imagemin": "^9.0.0",
|
|
127
|
+
"@types/node": "^20.14.2",
|
|
128
128
|
"@types/postcss-import": "^14.0.3",
|
|
129
129
|
"@types/postcss-url": "^10.0.4",
|
|
130
130
|
"@types/webpack-env": "^1.18.5",
|
|
131
131
|
"@types/webpack-sources": "^3.2.3",
|
|
132
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
133
|
-
"@typescript-eslint/parser": "^7.
|
|
134
|
-
"css-loader": "^7.1.
|
|
135
|
-
"cssnano": "^7.0.
|
|
132
|
+
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
|
133
|
+
"@typescript-eslint/parser": "^7.12.0",
|
|
134
|
+
"css-loader": "^7.1.2",
|
|
135
|
+
"cssnano": "^7.0.2",
|
|
136
136
|
"documentation-website": "^1.0.326",
|
|
137
|
-
"eslint": "^9.
|
|
137
|
+
"eslint": "^9.4.0",
|
|
138
138
|
"eslint-config-google": "^0.14.0",
|
|
139
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
139
|
+
"eslint-plugin-jsdoc": "^48.2.8",
|
|
140
140
|
"favicons": "^7.2.0",
|
|
141
141
|
"favicons-webpack-plugin": "^6.0.1",
|
|
142
|
-
"globals": "^15.
|
|
143
|
-
"image-minimizer-webpack-plugin": "^4.0.
|
|
142
|
+
"globals": "^15.3.0",
|
|
143
|
+
"image-minimizer-webpack-plugin": "^4.0.2",
|
|
144
144
|
"jest": "^29.7.0",
|
|
145
145
|
"jsdoc": "^4.0.3",
|
|
146
146
|
"mini-css-extract-plugin": "^2.9.0",
|
|
@@ -150,15 +150,15 @@
|
|
|
150
150
|
"postcss-fontpath": "^1.0.0",
|
|
151
151
|
"postcss-import": "^16.1.0",
|
|
152
152
|
"postcss-loader": "^8.1.1",
|
|
153
|
-
"postcss-preset-env": "^9.5.
|
|
153
|
+
"postcss-preset-env": "^9.5.14",
|
|
154
154
|
"postcss-sprites": "^4.2.1",
|
|
155
155
|
"postcss-url": "^10.1.3",
|
|
156
156
|
"shx": "^0.3.4",
|
|
157
157
|
"style-loader": "^4.0.0",
|
|
158
|
-
"stylelint": "^16.
|
|
158
|
+
"stylelint": "^16.6.1",
|
|
159
159
|
"stylelint-config-standard": "^36.0.0",
|
|
160
160
|
"stylelint-config-standard-scss": "^13.1.0",
|
|
161
|
-
"typescript-eslint": "^7.
|
|
161
|
+
"typescript-eslint": "^7.12.0",
|
|
162
162
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
163
163
|
"workbox-webpack-plugin": "^7.1.0"
|
|
164
164
|
},
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
"arguments": [
|
|
465
465
|
"--config",
|
|
466
466
|
{
|
|
467
|
-
"__evaluate__": "`'${webOptimizerPath}/eslint.config.
|
|
467
|
+
"__evaluate__": "`'${webOptimizerPath}/eslint.config.mjs'`"
|
|
468
468
|
},
|
|
469
469
|
"--ignore-pattern",
|
|
470
470
|
{
|
|
@@ -497,8 +497,6 @@
|
|
|
497
497
|
{
|
|
498
498
|
"__evaluate__": "Tools.isFileSync(path.resolve(currentPath, 'tsconfig.json')) ? '--parser-options=project:tsconfig.json' : ''"
|
|
499
499
|
},
|
|
500
|
-
"--resolve-plugins-relative-to",
|
|
501
|
-
".",
|
|
502
500
|
"'**/*.{jsx,ts,tsx}'"
|
|
503
501
|
],
|
|
504
502
|
"command": "eslint",
|
|
@@ -28,9 +28,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
28
28
|
var _clientnode = _interopRequireDefault(require("clientnode"));
|
|
29
29
|
var _jsdom = require("jsdom");
|
|
30
30
|
var _ejsLoader = _interopRequireDefault(require("../ejsLoader"));
|
|
31
|
-
function _createForOfIteratorHelper(
|
|
32
|
-
function _unsupportedIterableToArray(
|
|
33
|
-
function _arrayLikeToArray(
|
|
31
|
+
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; } } }; }
|
|
32
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
33
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
34
34
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
35
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
36
|
// endregion
|
package/webpackConfigurator.js
CHANGED
|
@@ -38,9 +38,9 @@ var _HTMLTransformation = _interopRequireDefault(require("./plugins/HTMLTransfor
|
|
|
38
38
|
var _optionalRequire, _configuration$path$c, _configuration$cache$, _configuration$cache, _configuration$cache2, _configuration$cache3, _configuration$path$c2;
|
|
39
39
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
40
40
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
41
|
-
function _createForOfIteratorHelper(
|
|
42
|
-
function _unsupportedIterableToArray(
|
|
43
|
-
function _arrayLikeToArray(
|
|
41
|
+
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; } } }; }
|
|
42
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
43
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
44
44
|
/// region optional imports
|
|
45
45
|
// NOTE: Has to be defined here to ensure to resolve from here.
|
|
46
46
|
var currentRequire =
|