weboptimizer 4.0.48 → 4.0.50
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weboptimizer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.50",
|
|
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.js",
|
|
37
37
|
"helper.d.ts",
|
|
38
38
|
"helper.js",
|
|
39
39
|
"index.d.ts",
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "yarn build:types; yarn build:lint; yarn build:plain",
|
|
66
|
-
"build:lint": " babel --extensions '.ts' --out-file eslint.config.
|
|
66
|
+
"build:lint": " babel --extensions '.ts' --out-file eslint.config.js eslint.config.ts",
|
|
67
67
|
"build:plain": "command=\"babel --extensions '.ts' --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 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",
|
|
68
|
-
"build:copy-test-artefacts": "cd test/simple && shx touch yarn.lock && rimraf node_modules && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && rimraf node_modules && 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 *.
|
|
68
|
+
"build:copy-test-artefacts": "cd test/simple && shx touch yarn.lock && rimraf node_modules && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install; cd ../../ && cd test/scss && shx touch yarn.lock && rimraf node_modules && 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/",
|
|
69
69
|
"build:test": " yarn clear && yarn build && command='babel --extensions '.ts' --source-root ../ --out-file' && yarn build:copy-test-artefacts && $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",
|
|
70
70
|
"build:test:source-map": "yarn clear && yarn build && command='babel --extensions '.ts' --source-maps inline --source-root ../ --out-file' && yarn build:copy-test-artefacts && $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:types": "tsc --declaration --emitDeclarationOnly",
|
|
72
72
|
"check": "yarn check:types; yarn lint",
|
|
73
73
|
"check:types": "tsc --noEmit",
|
|
74
|
-
"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 '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'
|
|
74
|
+
"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 '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' node_modules/weboptimizer .coverage .nyc_output",
|
|
75
75
|
"document": "yarn build:plain && jsdoc --package ./package.json --readme ./readme.md --destination apiDocumentation *.js",
|
|
76
76
|
"lint": "yarn build:lint && yarn lint:base",
|
|
77
77
|
"lint:base": "eslint --no-warn-ignored *.ts */*.ts test/*/*.ts",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"babel-loader": "^10.1.1",
|
|
95
95
|
"babel-plugin-polyfill-corejs3": "^1.0.0",
|
|
96
96
|
"babel-plugin-transform-rewrite-imports": "^1.5.4",
|
|
97
|
-
"clientnode": "4.0.
|
|
97
|
+
"clientnode": "4.0.1482",
|
|
98
98
|
"core-js": "^3.49.0",
|
|
99
99
|
"ejs": "^6.0.1",
|
|
100
100
|
"exports-loader": "^5.0.0",
|
|
@@ -127,15 +127,15 @@
|
|
|
127
127
|
"@types/postcss-url": "^10.0.4",
|
|
128
128
|
"@types/webpack-env": "^1.18.8",
|
|
129
129
|
"@types/webpack-sources": "^3.2.3",
|
|
130
|
-
"@typescript-eslint/parser": "^8.
|
|
130
|
+
"@typescript-eslint/parser": "^8.66.0",
|
|
131
131
|
"css-loader": "^7.1.4",
|
|
132
132
|
"cssnano": "^8.0.2",
|
|
133
133
|
"eslint": "^10.8.0",
|
|
134
134
|
"eslint-config-google": "^0.14.0",
|
|
135
|
-
"eslint-plugin-jsdoc": "^63.3.
|
|
135
|
+
"eslint-plugin-jsdoc": "^63.3.3",
|
|
136
136
|
"favicons": "^7.3.1",
|
|
137
137
|
"favicons-webpack-plugin": "^6.0.1",
|
|
138
|
-
"globals": "^17.
|
|
138
|
+
"globals": "^17.9.0",
|
|
139
139
|
"image-minimizer-webpack-plugin": "^5.0.0",
|
|
140
140
|
"jest": "^30.4.2",
|
|
141
141
|
"jsdoc": "^4.0.5",
|
|
@@ -155,9 +155,9 @@
|
|
|
155
155
|
"stylelint-config-standard": "^40.0.0",
|
|
156
156
|
"stylelint-config-standard-scss": "^17.0.0",
|
|
157
157
|
"terser-webpack-plugin": "^5.6.1",
|
|
158
|
-
"typescript-eslint": "^8.
|
|
158
|
+
"typescript-eslint": "^8.66.0",
|
|
159
159
|
"typescript-plugin-css-modules": "^5.2.0",
|
|
160
|
-
"web-documentation": "^1.0.
|
|
160
|
+
"web-documentation": "^1.0.45",
|
|
161
161
|
"workbox-webpack-plugin": "^7.4.1"
|
|
162
162
|
},
|
|
163
163
|
"peerDependencies": {
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
"types": {
|
|
384
384
|
"default": {
|
|
385
385
|
"filePathPattern": {
|
|
386
|
-
"__evaluate__": "`^${string.maskForRegularExpression(self.path.target.asset.javaScript)}.+(?:\\\\.[^.]+(?:\\\\.map)?)?\\\\.js$`"
|
|
386
|
+
"__evaluate__": "`^${string.maskForRegularExpression(self.path.target.asset.javaScript)}.+(?:\\\\.[^.]+(?:\\\\.map)?)?\\\\.c?js$`"
|
|
387
387
|
},
|
|
388
388
|
"outputExtension": "js",
|
|
389
389
|
"preinstall": {
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
"arguments": [
|
|
487
487
|
"--config",
|
|
488
488
|
{
|
|
489
|
-
"__evaluate__": "`'${webOptimizerPath}/eslint.config.
|
|
489
|
+
"__evaluate__": "`'${webOptimizerPath}/eslint.config.js'`"
|
|
490
490
|
},
|
|
491
491
|
"--ignore-pattern",
|
|
492
492
|
{
|
|
@@ -622,10 +622,11 @@
|
|
|
622
622
|
]
|
|
623
623
|
},
|
|
624
624
|
"external": {
|
|
625
|
-
"__evaluate__": "self.generic.isWeb ? self.extensions.file.internal : ['.compiled.js', '.js', '.json', '.mjs']"
|
|
625
|
+
"__evaluate__": "self.generic.isWeb ? self.extensions.file.internal : ['.compiled.js', '.cjs', '.js', '.json', '.mjs']"
|
|
626
626
|
},
|
|
627
627
|
"internal": [
|
|
628
628
|
".compiled.js",
|
|
629
|
+
".cjs",
|
|
629
630
|
".mjs",
|
|
630
631
|
".js",
|
|
631
632
|
".jsx",
|
|
@@ -859,6 +860,7 @@
|
|
|
859
860
|
"extensions": {
|
|
860
861
|
"file": [
|
|
861
862
|
".compiled.js",
|
|
863
|
+
".cjs",
|
|
862
864
|
".mjs",
|
|
863
865
|
".js"
|
|
864
866
|
]
|
|
@@ -1117,6 +1119,7 @@
|
|
|
1117
1119
|
"loader": "ejs-loader",
|
|
1118
1120
|
"options": {
|
|
1119
1121
|
"compiler": {
|
|
1122
|
+
"async": true,
|
|
1120
1123
|
"cache": true,
|
|
1121
1124
|
"compileDebug": false,
|
|
1122
1125
|
"debug": false,
|
|
@@ -1567,6 +1570,7 @@
|
|
|
1567
1570
|
"watchOptions": {
|
|
1568
1571
|
"ignored": [
|
|
1569
1572
|
"./.yarn",
|
|
1573
|
+
"./*.cjs",
|
|
1570
1574
|
"./*.js",
|
|
1571
1575
|
"./end-to-end-tests",
|
|
1572
1576
|
"**/.*",
|
package/webpackConfigurator.js
CHANGED
|
@@ -290,13 +290,13 @@ if (module.enforceDeduplication) {
|
|
|
290
290
|
const absoluteContextPath = resolve(configuration.path.context);
|
|
291
291
|
const consolidator = async result => {
|
|
292
292
|
const targetPath = result.createData.resource;
|
|
293
|
-
if (targetPath && /((
|
|
293
|
+
if (targetPath && /((?:^|\/)node_modules\/.+)/.test(targetPath) && (!targetPath.startsWith(absoluteContextPath) || /((?:^|\/)node_modules\/.+){2}/.test(targetPath)) && isFileSync(targetPath)) {
|
|
294
294
|
const packageDescriptor = await getClosestPackageDescriptor(targetPath);
|
|
295
295
|
if (packageDescriptor) {
|
|
296
296
|
let pathPrefixes;
|
|
297
297
|
let pathSuffix;
|
|
298
298
|
if (targetPath.startsWith(absoluteContextPath)) {
|
|
299
|
-
const matches = targetPath.match(/((
|
|
299
|
+
const matches = targetPath.match(/((?:^|.*?\/)node_modules\/)/g);
|
|
300
300
|
if (matches === null) return;
|
|
301
301
|
pathPrefixes = Array.from(matches);
|
|
302
302
|
/*
|
|
@@ -309,7 +309,7 @@ if (module.enforceDeduplication) {
|
|
|
309
309
|
if (index > 0) pathPrefixes[index] = resolve(pathPrefixes[index - 1], pathPrefix);
|
|
310
310
|
index += 1;
|
|
311
311
|
}
|
|
312
|
-
pathSuffix = targetPath.replace(/(
|
|
312
|
+
pathSuffix = targetPath.replace(/(?:^|.*\/)node_modules\/(.+$)/, '$1');
|
|
313
313
|
} else {
|
|
314
314
|
pathPrefixes = [resolve(absoluteContextPath, 'node_modules')];
|
|
315
315
|
// Find longest common prefix.
|
|
@@ -574,7 +574,7 @@ const genericLoader = {
|
|
|
574
574
|
}
|
|
575
575
|
return Boolean(result);
|
|
576
576
|
},
|
|
577
|
-
test: /\.s?css(
|
|
577
|
+
test: /\.s?css(?:\?.*)?$/i,
|
|
578
578
|
use: cssUse
|
|
579
579
|
},
|
|
580
580
|
// endregion
|
|
@@ -589,7 +589,7 @@ const genericLoader = {
|
|
|
589
589
|
generator: {
|
|
590
590
|
filename: join(relative(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + `?${configuration.hashAlgorithm}=[contenthash]`
|
|
591
591
|
},
|
|
592
|
-
test: /\.eot(
|
|
592
|
+
test: /\.eot(?:\?.*)?$/i,
|
|
593
593
|
type: 'asset/resource',
|
|
594
594
|
parser: {
|
|
595
595
|
dataUrlCondition: {
|
|
@@ -613,7 +613,7 @@ const genericLoader = {
|
|
|
613
613
|
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
614
614
|
}
|
|
615
615
|
},
|
|
616
|
-
test: /\.svg(
|
|
616
|
+
test: /\.svg(?:\?.*)?$/i,
|
|
617
617
|
type: 'asset/resource',
|
|
618
618
|
use: await Promise.all(module.optimizer.font.svg.loader.map(createEvaluateMapper('font.svg')))
|
|
619
619
|
},
|
|
@@ -625,7 +625,7 @@ const genericLoader = {
|
|
|
625
625
|
generator: {
|
|
626
626
|
filename: join(relative(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + `?${configuration.hashAlgorithm}=[contenthash]`
|
|
627
627
|
},
|
|
628
|
-
test: /\.ttf(
|
|
628
|
+
test: /\.ttf(?:\?.*)?$/i,
|
|
629
629
|
type: 'asset/resource',
|
|
630
630
|
mimetype: 'application/octet-stream',
|
|
631
631
|
parser: {
|
|
@@ -643,7 +643,7 @@ const genericLoader = {
|
|
|
643
643
|
generator: {
|
|
644
644
|
filename: join(relative(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + `?${configuration.hashAlgorithm}=[contenthash]`
|
|
645
645
|
},
|
|
646
|
-
test: /\.woff2?(
|
|
646
|
+
test: /\.woff2?(?:\?.*)?$/i,
|
|
647
647
|
type: 'asset/resource',
|
|
648
648
|
parser: {
|
|
649
649
|
dataUrlCondition: {
|
|
@@ -664,7 +664,7 @@ const genericLoader = {
|
|
|
664
664
|
filename: typeof configuration.path.target.asset.image === 'string' ? join(relative(configuration.path.target.base, configuration.path.target.asset.image), '[name][ext]') + `?${configuration.hashAlgorithm}=[contenthash]` : configuration.path.target.asset.image
|
|
665
665
|
},
|
|
666
666
|
include: configuration.path.source.asset.image,
|
|
667
|
-
test: /\.(?:
|
|
667
|
+
test: /\.(?:gif|ico|jpg|png|svg)(?:\?.*)?$/i,
|
|
668
668
|
type: 'asset/resource',
|
|
669
669
|
parser: {
|
|
670
670
|
dataUrlCondition: {
|
|
File without changes
|