@merkur/tool-webpack 0.30.0 โ†’ 0.32.0

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/CHANGELOG.md CHANGED
@@ -3,101 +3,82 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.30.0](https://github.com/mjancarik/merkur/compare/v0.29.5...v0.30.0) (2022-11-28)
6
+ # [0.32.0](https://github.com/mjancarik/merkur/compare/v0.31.1...v0.32.0) (2023-07-14)
7
7
 
8
- **Note:** Version bump only for package @merkur/tool-webpack
8
+ ### Features
9
9
 
10
+ - ๐ŸŽธ remove ES5 Javascript ([cc782ad](https://github.com/mjancarik/merkur/commit/cc782adcdf8e19ddf79cba9e134dec6f96ec6893))
10
11
 
12
+ ### BREAKING CHANGES
11
13
 
14
+ - ๐Ÿงจ Remove supports for old browsers(IE11, etc.). Minimal supported browsers
15
+ use ES9.
12
16
 
17
+ # [0.31.0](https://github.com/mjancarik/merkur/compare/v0.30.1...v0.31.0) (2023-04-25)
13
18
 
14
- # [0.29.0](https://github.com/mjancarik/merkur/compare/v0.28.2...v0.29.0) (2022-08-08)
19
+ ### Features
15
20
 
16
- **Note:** Version bump only for package @merkur/tool-webpack
21
+ - ๐ŸŽธ Add support of OpenSSL 3 in Node.js >= 17 ([a8f3385](https://github.com/mjancarik/merkur/commit/a8f33853e0eaea8482611f99bed6f02228048d05))
17
22
 
23
+ # [0.30.0](https://github.com/mjancarik/merkur/compare/v0.29.5...v0.30.0) (2022-11-28)
18
24
 
25
+ **Note:** Version bump only for package @merkur/tool-webpack
19
26
 
27
+ # [0.29.0](https://github.com/mjancarik/merkur/compare/v0.28.2...v0.29.0) (2022-08-08)
20
28
 
29
+ **Note:** Version bump only for package @merkur/tool-webpack
21
30
 
22
31
  # [0.28.0](https://github.com/mjancarik/merkur/compare/v0.27.6...v0.28.0) (2022-04-20)
23
32
 
24
-
25
33
  ### Code Refactoring
26
34
 
27
- * ๐Ÿ’ก move liveReloadServer to merkur/tools ([f81e0e8](https://github.com/mjancarik/merkur/commit/f81e0e89eff4a72985c89d23079be6a9344a3b2e))
28
-
35
+ - ๐Ÿ’ก move liveReloadServer to merkur/tools ([f81e0e8](https://github.com/mjancarik/merkur/commit/f81e0e89eff4a72985c89d23079be6a9344a3b2e))
29
36
 
30
37
  ### BREAKING CHANGES
31
38
 
32
- * ๐Ÿงจ The liveReloadServer.cjs file is moved to @merkur/tools. The
33
- @merkur/tool-webpack re-export createLiveReloadServer for keeping
34
- backward compatability.
35
-
36
-
37
-
38
-
39
+ - ๐Ÿงจ The liveReloadServer.cjs file is moved to @merkur/tools. The
40
+ @merkur/tool-webpack re-export createLiveReloadServer for keeping
41
+ backward compatability.
39
42
 
40
43
  ## [0.27.4](https://github.com/mjancarik/merkur/compare/v0.27.3...v0.27.4) (2021-10-06)
41
44
 
42
-
43
45
  ### Features
44
46
 
45
- * ๐ŸŽธ Allow CssMinimizerPlugin options override ([#114](https://github.com/mjancarik/merkur/issues/114)) ([c02dd0b](https://github.com/mjancarik/merkur/commit/c02dd0bf06a44bbf45880c9b1932a33e287f35ce))
46
-
47
-
48
-
49
-
47
+ - ๐ŸŽธ Allow CssMinimizerPlugin options override ([#114](https://github.com/mjancarik/merkur/issues/114)) ([c02dd0b](https://github.com/mjancarik/merkur/commit/c02dd0bf06a44bbf45880c9b1932a33e287f35ce))
50
48
 
51
49
  ## [0.27.3](https://github.com/mjancarik/merkur/compare/v0.27.2...v0.27.3) (2021-10-04)
52
50
 
53
-
54
51
  ### Bug Fixes
55
52
 
56
- * ๐Ÿ› Windows babel es5 build issue with exclude pattern ([#113](https://github.com/mjancarik/merkur/issues/113)) ([26387ea](https://github.com/mjancarik/merkur/commit/26387ea01d840d5d6f55d4748d34c87c7f3f5f10))
57
-
58
-
59
-
60
-
53
+ - ๐Ÿ› Windows babel es5 build issue with exclude pattern ([#113](https://github.com/mjancarik/merkur/issues/113)) ([26387ea](https://github.com/mjancarik/merkur/commit/26387ea01d840d5d6f55d4748d34c87c7f3f5f10))
61
54
 
62
55
  ## [0.27.1](https://github.com/mjancarik/merkur/compare/v0.27.0...v0.27.1) (2021-09-30)
63
56
 
64
57
  **Note:** Version bump only for package @merkur/tool-webpack
65
58
 
66
-
67
-
68
-
69
-
70
59
  # [0.27.0](https://github.com/mjancarik/merkur/compare/v0.26.1...v0.27.0) (2021-09-29)
71
60
 
72
-
73
61
  ### Features
74
62
 
75
- * ๐ŸŽธ Added default support for asset image resources ([bd94f8d](https://github.com/mjancarik/merkur/commit/bd94f8d1a536335363a0f3381f85e57448078ac3))
76
- * ๐ŸŽธ Automatically generate free port for livereload server ([#101](https://github.com/mjancarik/merkur/issues/101)) ([a083a1b](https://github.com/mjancarik/merkur/commit/a083a1b31edc818a2d94e000a78cbb03cc8dc022))
77
-
63
+ - ๐ŸŽธ Added default support for asset image resources ([bd94f8d](https://github.com/mjancarik/merkur/commit/bd94f8d1a536335363a0f3381f85e57448078ac3))
64
+ - ๐ŸŽธ Automatically generate free port for livereload server ([#101](https://github.com/mjancarik/merkur/issues/101)) ([a083a1b](https://github.com/mjancarik/merkur/commit/a083a1b31edc818a2d94e000a78cbb03cc8dc022))
78
65
 
79
66
  ### BREAKING CHANGES
80
67
 
81
- * ๐Ÿงจ createLiveReloadServer() function must be promise chained in
82
- webpack.config.js before returning any config array.
83
-
84
-
85
-
86
-
68
+ - ๐Ÿงจ createLiveReloadServer() function must be promise chained in
69
+ webpack.config.js before returning any config array.
87
70
 
88
71
  # [0.26.0](https://github.com/mjancarik/merkur/compare/v0.25.0...v0.26.0) (2021-08-27)
89
72
 
90
-
91
73
  ### Features
92
74
 
93
- * ๐ŸŽธ create new module tool-webpack ([#99](https://github.com/mjancarik/merkur/issues/99)) ([111fda7](https://github.com/mjancarik/merkur/commit/111fda7a6854528472b8539ec12fffe7a1d7efae))
94
-
75
+ - ๐ŸŽธ create new module tool-webpack ([#99](https://github.com/mjancarik/merkur/issues/99)) ([111fda7](https://github.com/mjancarik/merkur/commit/111fda7a6854528472b8539ec12fffe7a1d7efae))
95
76
 
96
77
  ### BREAKING CHANGES
97
78
 
98
- * ๐Ÿงจ Extract webpack to alone module merkur/tool-webpack from merkur/tools
99
- module
79
+ - ๐Ÿงจ Extract webpack to alone module merkur/tool-webpack from merkur/tools
80
+ module
100
81
 
101
- * ci: ๐ŸŽก add lock file for new module
82
+ - ci: ๐ŸŽก add lock file for new module
102
83
 
103
- * feat: ๐ŸŽธ add new module merkur/tool-webpack to dev dependencies
84
+ - feat: ๐ŸŽธ add new module merkur/tool-webpack to dev dependencies
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  ![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/@merkur/core/latest)
12
12
  [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
13
13
 
14
- The [Merkur](https://merkur.js.org/) is tiny extensible javascript library for front-end microservices(micro frontends). It allows by default server side rendering for loading performance boost. You can connect it with other frameworks or languages because merkur defines easy API. You can use one of six predefined template's library [React](https://reactjs.org/), [Preact](https://preactjs.com/), [hyperHTML](https://viperhtml.js.org/hyper.html), [ยตhtml](https://github.com/WebReflection/uhtml#readme), [Svelte](https://svelte.dev/) and [vanilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) but you can easily extend for others.
14
+ The [Merkur](https://merkur.js.org/) is tiny extensible javascript library for front-end microservices(micro frontends). It allows by default server side rendering for loading performance boost. You can connect it with other frameworks or languages because merkur defines easy API. You can use one of six predefined template's library [Preact](https://preactjs.com/), [ยตhtml](https://github.com/WebReflection/uhtml#readme), [Svelte](https://svelte.dev/) and [vanilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) but you can easily extend for others.
15
15
 
16
16
  ## Features
17
17
  - Flexible templating engine
package/index.cjs CHANGED
@@ -16,7 +16,6 @@ const { applyBundleAnalyzer } = require('./module/bundleAnalyzer.cjs');
16
16
  const {
17
17
  findLoaders,
18
18
  applyES9Transformation,
19
- applyES5Transformation,
20
19
  } = require('./module/babelLoader.cjs');
21
20
  const { applyStyleLoaders } = require('./module/styleLoader.cjs');
22
21
 
@@ -253,6 +252,5 @@ module.exports = {
253
252
  createLiveReloadServer,
254
253
  applyBundleAnalyzer,
255
254
  applyES9Transformation,
256
- applyES5Transformation,
257
255
  applyStyleLoaders,
258
256
  };
@@ -50,45 +50,31 @@ function createESTransformation(
50
50
  alias: {
51
51
  '@merkur/core': path.join(
52
52
  nodeModulesDir,
53
- `@merkur/core/lib/index.${esVersion}.${
54
- esVersion === 'es5' ? 'js' : 'mjs'
55
- }`
53
+ `@merkur/core/lib/index.${esVersion}.mjs`
56
54
  ),
57
55
  '@merkur/plugin-component': path.join(
58
56
  nodeModulesDir,
59
- `@merkur/plugin-component/lib/index.${esVersion}.${
60
- esVersion === 'es5' ? 'js' : 'mjs'
61
- }`
57
+ `@merkur/plugin-component/lib/index.mjs`
62
58
  ),
63
59
  '@merkur/plugin-event-emitter': path.join(
64
60
  nodeModulesDir,
65
- `@merkur/plugin-event-emitter/lib/index.${esVersion}.${
66
- esVersion === 'es5' ? 'js' : 'mjs'
67
- }`
61
+ `@merkur/plugin-event-emitter/lib/index.mjs`
68
62
  ),
69
63
  '@merkur/plugin-http-client': path.join(
70
64
  nodeModulesDir,
71
- `@merkur/plugin-http-client/lib/index.${esVersion}.${
72
- esVersion === 'es5' ? 'js' : 'mjs'
73
- }`
65
+ `@merkur/plugin-http-client/lib/index.mjs`
74
66
  ),
75
67
  '@merkur/plugin-error': path.join(
76
68
  nodeModulesDir,
77
- `@merkur/plugin-error/lib/index.${esVersion}.${
78
- esVersion === 'es5' ? 'js' : 'mjs'
79
- }`
69
+ `@merkur/plugin-error/lib/index.mjs`
80
70
  ),
81
71
  '@merkur/plugin-router': path.join(
82
72
  nodeModulesDir,
83
- `@merkur/plugin-router/lib/index.${esVersion}.${
84
- esVersion === 'es5' ? 'js' : 'mjs'
85
- }`
73
+ `@merkur/plugin-router/lib/index.mjs`
86
74
  ),
87
75
  '@merkur/plugin-css-scrambler': path.join(
88
76
  nodeModulesDir,
89
- `@merkur/plugin-router/lib/index.${esVersion}.${
90
- esVersion === 'es5' ? 'js' : 'mjs'
91
- }`
77
+ `@merkur/plugin-router/lib/index.mjs`
92
78
  ),
93
79
  ...config.resolve.alias,
94
80
  },
@@ -163,24 +149,7 @@ function applyES9Transformation(config, context) {
163
149
  return config;
164
150
  }
165
151
 
166
- function applyES5Transformation(config, context) {
167
- config = createESTransformation(config, context, 'es5');
168
- config.output.environment = {
169
- arrowFunction: false,
170
- bigIntLiteral: false,
171
- const: false,
172
- destructuring: false,
173
- dynamicImport: false,
174
- forOf: false,
175
- module: false,
176
- ...config.output?.environment,
177
- };
178
-
179
- return config;
180
- }
181
-
182
152
  module.exports = {
183
153
  findLoaders,
184
154
  applyES9Transformation,
185
- applyES5Transformation,
186
155
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkur/tool-webpack",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "description": "Merkur tool webpack.",
5
5
  "main": "index.cjs",
6
6
  "scripts": {
@@ -28,33 +28,33 @@
28
28
  },
29
29
  "homepage": "https://merkur.js.org/",
30
30
  "dependencies": {
31
- "@babel/core": "^7.17.9",
32
- "@babel/preset-env": "^7.16.11",
33
- "autoprefixer": "^10.4.4",
34
- "babel-loader": "8.2.4",
31
+ "@babel/core": "^7.21.8",
32
+ "@babel/preset-env": "^7.21.5",
33
+ "autoprefixer": "^10.4.14",
34
+ "babel-loader": "9.1.2",
35
35
  "clean-webpack-plugin": "^4.0.0",
36
- "compression-webpack-plugin": "^9.2.0",
37
- "core-js": "^3.22.0",
38
- "css-loader": "^6.7.1",
39
- "css-minimizer-webpack-plugin": "^3.4.1",
36
+ "compression-webpack-plugin": "^10.0.0",
37
+ "core-js": "^3.30.2",
38
+ "css-loader": "^6.7.3",
39
+ "css-minimizer-webpack-plugin": "^5.0.0",
40
40
  "json-loader": "0.5.7",
41
- "less": "^4.1.2",
42
- "less-loader": "^10.2.0",
43
- "mini-css-extract-plugin": "^2.6.0",
44
- "postcss": "^8.4.12",
41
+ "less": "^4.1.3",
42
+ "less-loader": "^11.1.0",
43
+ "mini-css-extract-plugin": "^2.7.5",
44
+ "postcss": "^8.4.23",
45
45
  "postcss-flexbugs-fixes": "^5.0.2",
46
46
  "postcss-less": "^6.0.0",
47
- "postcss-loader": "^6.2.1",
48
- "postcss-preset-env": "^7.4.3",
49
- "source-map-loader": "^3.0.1",
50
- "webpack-bundle-analyzer": "^4.5.0",
47
+ "postcss-loader": "^7.3.0",
48
+ "postcss-preset-env": "^8.3.2",
49
+ "source-map-loader": "^4.0.1",
50
+ "webpack-bundle-analyzer": "^4.8.0",
51
51
  "webpack-manifest-plugin": "5.0.0",
52
52
  "webpack-modules": "1.0.0",
53
53
  "webpack-node-externals": "3.0.0",
54
- "webpack-shell-plugin-next": "^2.2.2"
54
+ "webpack-shell-plugin-next": "^2.3.1"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@merkur/tools": "*"
58
58
  },
59
- "gitHead": "13a0ac12f77f381b1d829cffe9b21d453c26ca7a"
59
+ "gitHead": "c45ffe12725e3c4afcf7f13869a25a96f6807055"
60
60
  }
package/webpack/cache.cjs CHANGED
@@ -3,7 +3,15 @@ const fs = require('fs');
3
3
  const path = require('path');
4
4
 
5
5
  function createCacheKey(...args) {
6
- return createHash('md4')
6
+ let hash;
7
+
8
+ try {
9
+ hash = createHash('sha256');
10
+ } catch (err) {
11
+ hash = createHash('md5');
12
+ }
13
+
14
+ return hash
7
15
  .update(
8
16
  args
9
17
  .filter(Boolean)