@pixolith/webpack-sw6-config 7.4.3 → 7.5.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixolith/webpack-sw6-config",
3
3
  "public": true,
4
- "version": "7.4.3",
4
+ "version": "7.5.1",
5
5
  "description": "",
6
6
  "main": "src/index.js",
7
7
  "scripts": {},
@@ -21,7 +21,7 @@
21
21
  "url": "https://github.com/pixolith/webpack-plugins/issues"
22
22
  },
23
23
  "homepage": "https://github.com/pixolith/webpack-plugins/tree/master/packages/webpack-hook-plugin/#readme",
24
- "gitHead": "8e347cc5f3f8148994f8a2510bf2a179716a1fc9",
24
+ "gitHead": "a0131a86ccd750d1249de2675f20ca575bef6b94",
25
25
  "dependencies": {
26
26
  "@babel/core": "^7.22.1",
27
27
  "@babel/eslint-parser": "^7.21.8",
@@ -60,11 +60,11 @@
60
60
  "eslint-webpack-plugin": "^4.0.1",
61
61
  "execa": "^7.1.1",
62
62
  "external-svg-sprite-loader": "^7.2.0",
63
- "extract-css-chunks-webpack-plugin": "^4.9.0",
64
63
  "file-loader": "^6.2.0",
65
64
  "glob": "^10.2.7",
66
65
  "html-loader": "^4.2.0",
67
66
  "media-query-plugin": "^1.5.0",
67
+ "mini-css-extract-plugin": "^2.8.1",
68
68
  "postcss": "^8.4.24",
69
69
  "postcss-loader": "^7.3.2",
70
70
  "postcss-pxtorem": "^6.0.0",
@@ -5,7 +5,7 @@ const Path = require('path'),
5
5
  entry = require('webpack-glob-entry'),
6
6
  publicPath = process.env.PUBLIC_PATH,
7
7
  spritePath = process.env.SPRITE_PATH ?? 'custom/plugins/PxswTheme/src/Resources/views/administration',
8
- ExtractCssChunks = require('extract-css-chunks-webpack-plugin'),
8
+ MiniCssExtractPlugin = require('mini-css-extract-plugin'),
9
9
  AssetsCopyPlugin = require('@pixolith/webpack-assets-copy-plugin'),
10
10
  isProd = process.env.NODE_ENV === 'production',
11
11
  SvgStorePlugin = require('@pixolith/external-svg-sprite-loader'),
@@ -22,18 +22,19 @@ const Path = require('path'),
22
22
  /-/g,
23
23
  '',
24
24
  )}/administration/js/${pluginName}.js`;
25
- },
25
+ }
26
26
  },
27
- extractCssChunksConfig = {
28
- moduleFilename: ({ name }) => {
29
- let pluginName = name.replace('vendor-', '').toLowerCase();
27
+ miniCssChunksConfig = {
28
+ filename: (chunkData) => {
29
+ let pluginName = chunkData.chunk.name
30
+ .toLowerCase()
31
+ .replace('vendor-', '');
30
32
  return `${pluginName.replace(
31
33
  /-/g,
32
34
  '',
33
35
  )}/administration/css/${pluginName}.css`;
34
- },
35
- hot: !isProd,
36
- };
36
+ }
37
+ }
37
38
 
38
39
  module.exports = {
39
40
  entry: () => {
@@ -197,7 +198,7 @@ module.exports = {
197
198
  },
198
199
  }),
199
200
 
200
- new ExtractCssChunks(extractCssChunksConfig),
201
+ new MiniCssExtractPlugin(miniCssChunksConfig),
201
202
  ],
202
203
 
203
204
  optimization: {
@@ -6,7 +6,7 @@ const webpack = require('webpack'),
6
6
  StyleLintPlugin = require('stylelint-webpack-plugin'),
7
7
  isProd = process.env.NODE_ENV === 'production',
8
8
  privatePath = process.env.PLUGIN_PATH,
9
- ExtractCssChunks = require('extract-css-chunks-webpack-plugin'),
9
+ MiniCssExtractPlugin = require('mini-css-extract-plugin'),
10
10
  //MediaQueryPlugin = require('media-query-plugin'),
11
11
  FilenameLinterPlugin = require('@pixolith/webpack-filename-linter-plugin'),
12
12
  ESLintPlugin = require('eslint-webpack-plugin'),
@@ -41,25 +41,12 @@ module.exports = {
41
41
  {
42
42
  test: /(\.scss|\.css)$/,
43
43
  use: [
44
- isProd ? ExtractCssChunks.loader : 'style-loader',
45
- {
46
- loader: 'string-replace-loader',
47
- options: {
48
- search: 'ASSET_URL/',
49
- replace: ASSET_URL,
50
- flags: 'g',
51
- },
52
- },
44
+ isProd ? MiniCssExtractPlugin.loader : 'style-loader',
53
45
  {
54
46
  loader: 'css-loader',
55
47
  options: {
56
48
  importLoaders: 1,
57
49
  sourceMap: !isProd,
58
- url: {
59
- filter: (url) => {
60
- return !url.includes('ASSET_URL');
61
- }
62
- }
63
50
  },
64
51
  },
65
52
  //{
@@ -24,9 +24,10 @@ const webpack = require('webpack'),
24
24
  new CssMinimizerPlugin({
25
25
  minimizerOptions: {
26
26
  preset: [
27
- "advanced",
27
+ "default",
28
28
  {
29
29
  zIndex: false,
30
+ discardComments: { removeAll: true }
30
31
  },
31
32
  ],
32
33
  },
@@ -1,6 +1,6 @@
1
1
  const Path = require('path'),
2
2
  Fs = require('fs'),
3
- ExtractCssChunks = require('extract-css-chunks-webpack-plugin'),
3
+ MiniCssExtractPlugin = require('mini-css-extract-plugin'),
4
4
  privatePath = process.env.PLUGIN_PATH,
5
5
  vendorPath = process.env.VENDOR_PATH,
6
6
  spritePath = process.env.SPRITE_PATH ?? 'custom/plugins/PxswTheme/src/Resources/views/storefront',
@@ -28,14 +28,13 @@ const Path = require('path'),
28
28
  : '') + (isProd ? `.${chunkData.chunk.hash}` : '')}.js`;
29
29
  },
30
30
  },
31
- extractCssChunksConfig = {
31
+ miniCssChunksConfig = {
32
32
  filename: `css/[name]${isModern ? '.modern' : ''}${
33
33
  isProd ? '.[contenthash]' : ''
34
34
  }.css`,
35
35
  chunkFilename: `css/[name].vendor${isModern ? '.modern' : ''}${
36
36
  isProd ? '.[contenthash]' : ''
37
- }.css`,
38
- hot: !isProd,
37
+ }.css`
39
38
  };
40
39
 
41
40
  module.exports = {
@@ -252,6 +251,6 @@ module.exports = {
252
251
  },
253
252
  }),
254
253
 
255
- new ExtractCssChunks(extractCssChunksConfig),
254
+ new MiniCssExtractPlugin(miniCssChunksConfig),
256
255
  ],
257
256
  };