@merkur/tool-webpack 0.27.3 โ†’ 0.29.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,6 +3,43 @@
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.29.0](https://github.com/mjancarik/merkur/compare/v0.28.2...v0.29.0) (2022-08-08)
7
+
8
+ **Note:** Version bump only for package @merkur/tool-webpack
9
+
10
+
11
+
12
+
13
+
14
+ # [0.28.0](https://github.com/mjancarik/merkur/compare/v0.27.6...v0.28.0) (2022-04-20)
15
+
16
+
17
+ ### Code Refactoring
18
+
19
+ * ๐Ÿ’ก move liveReloadServer to merkur/tools ([f81e0e8](https://github.com/mjancarik/merkur/commit/f81e0e89eff4a72985c89d23079be6a9344a3b2e))
20
+
21
+
22
+ ### BREAKING CHANGES
23
+
24
+ * ๐Ÿงจ The liveReloadServer.cjs file is moved to @merkur/tools. The
25
+ @merkur/tool-webpack re-export createLiveReloadServer for keeping
26
+ backward compatability.
27
+
28
+
29
+
30
+
31
+
32
+ ## [0.27.4](https://github.com/mjancarik/merkur/compare/v0.27.3...v0.27.4) (2021-10-06)
33
+
34
+
35
+ ### Features
36
+
37
+ * ๐ŸŽธ Allow CssMinimizerPlugin options override ([#114](https://github.com/mjancarik/merkur/issues/114)) ([c02dd0b](https://github.com/mjancarik/merkur/commit/c02dd0bf06a44bbf45880c9b1932a33e287f35ce))
38
+
39
+
40
+
41
+
42
+
6
43
  ## [0.27.3](https://github.com/mjancarik/merkur/compare/v0.27.2...v0.27.3) (2021-10-04)
7
44
 
8
45
 
package/index.cjs CHANGED
@@ -9,7 +9,9 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
9
9
  const CompressionPlugin = require('compression-webpack-plugin');
10
10
 
11
11
  const { createCache, createCacheKey } = require('./webpack/cache.cjs');
12
- const { createLiveReloadServer } = require('./webpack/liveReloadServer.cjs');
12
+ const {
13
+ createLiveReloadServer,
14
+ } = require('@merkur/tools/liveReloadServer.cjs');
13
15
  const { applyBundleAnalyzer } = require('./module/bundleAnalyzer.cjs');
14
16
  const {
15
17
  findLoaders,
@@ -168,7 +170,7 @@ function createWebConfig(config, context) {
168
170
  module: {
169
171
  ...baseConfig?.module,
170
172
  rules: [
171
- ...baseConfig?.module?.rules,
173
+ ...(baseConfig?.module?.rules ?? []),
172
174
  {
173
175
  test: /\.m?js/,
174
176
  resolve: {
@@ -133,7 +133,7 @@ function createESTransformation(
133
133
  cacheIdentifier: createCacheKey(
134
134
  environment,
135
135
  config?.name,
136
- ...cache?.versionDependencies
136
+ ...(cache?.versionDependencies ?? [])
137
137
  ),
138
138
  cacheDirectory: true,
139
139
  cacheCompression: false,
@@ -81,7 +81,7 @@ function applyStyleLoaders(config, context) {
81
81
 
82
82
  config.optimization = {
83
83
  ...config.optimization,
84
- minimizer: ['...', new CssMinimizerPlugin()],
84
+ minimizer: ['...', new CssMinimizerPlugin(plugins.CssMinimizerPlugin)],
85
85
  };
86
86
 
87
87
  config.plugins.push(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkur/tool-webpack",
3
- "version": "0.27.3",
3
+ "version": "0.29.0",
4
4
  "description": "Merkur tool webpack.",
5
5
  "main": "index.cjs",
6
6
  "scripts": {
@@ -28,31 +28,33 @@
28
28
  },
29
29
  "homepage": "https://merkur.js.org/",
30
30
  "dependencies": {
31
- "@babel/core": "^7.15.5",
32
- "@babel/preset-env": "^7.15.6",
33
- "autoprefixer": "^10.3.6",
34
- "babel-loader": "8.2.2",
31
+ "@babel/core": "^7.17.9",
32
+ "@babel/preset-env": "^7.16.11",
33
+ "autoprefixer": "^10.4.4",
34
+ "babel-loader": "8.2.4",
35
35
  "clean-webpack-plugin": "^4.0.0",
36
- "compression-webpack-plugin": "^9.0.0",
37
- "core-js": "^3.18.1",
38
- "css-loader": "^6.3.0",
39
- "css-minimizer-webpack-plugin": "^3.0.2",
40
- "find-free-port": "^2.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",
41
40
  "json-loader": "0.5.7",
42
- "less": "^4.1.1",
43
- "less-loader": "^10.0.1",
44
- "mini-css-extract-plugin": "^2.3.0",
45
- "postcss": "^8.3.8",
41
+ "less": "^4.1.2",
42
+ "less-loader": "^10.2.0",
43
+ "mini-css-extract-plugin": "^2.6.0",
44
+ "postcss": "^8.4.12",
46
45
  "postcss-flexbugs-fixes": "^5.0.2",
47
- "postcss-less": "^5.0.0",
48
- "postcss-loader": "^6.1.1",
49
- "postcss-preset-env": "^6.7.0",
50
- "source-map-loader": "^3.0.0",
51
- "webpack-bundle-analyzer": "^4.4.2",
52
- "webpack-manifest-plugin": "4.0.2",
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",
51
+ "webpack-manifest-plugin": "5.0.0",
53
52
  "webpack-modules": "1.0.0",
54
53
  "webpack-node-externals": "3.0.0",
55
54
  "webpack-shell-plugin-next": "^2.2.2"
56
55
  },
57
- "gitHead": "ebc6172d76b62b8e19ea131514af3964e0c41236"
56
+ "peerDependencies": {
57
+ "@merkur/tools": "*"
58
+ },
59
+ "gitHead": "ddc13f0ef4d1b18a02461011dae5df49d55f03a6"
58
60
  }
package/webpack/cache.cjs CHANGED
@@ -16,7 +16,7 @@ function createCacheKey(...args) {
16
16
  function createCache({ cwd, cache, environment }) {
17
17
  return {
18
18
  type: 'filesystem',
19
- version: createCacheKey(environment, ...cache?.versionDependencies),
19
+ version: createCacheKey(environment, ...(cache?.versionDependencies ?? [])),
20
20
  buildDependencies: {
21
21
  defaultWebpack: ['webpack/lib/'],
22
22
  config: [path.resolve(cwd, 'webpack.config.js')].filter(fs.existsSync),
@@ -1,20 +0,0 @@
1
- const fp = require('find-free-port');
2
- const WebSocket = require('@merkur/tools/websocket.cjs');
3
-
4
- async function createLiveReloadServer() {
5
- if (process.env.NODE_ENV === 'development') {
6
- try {
7
- const [freePort] = await fp(4321);
8
- process.env.MERKUR_PLAYGROUND_LIVERELOAD_PORT = freePort;
9
-
10
- WebSocket.createServer({
11
- port: freePort,
12
- });
13
- } catch (error) {
14
- console.error(error);
15
- throw new Error('Unable to retrieve free port for livereload server.');
16
- }
17
- }
18
- }
19
-
20
- module.exports = { createLiveReloadServer };