@pixolith/webpack-sw6-config 7.4.2 → 7.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixolith/webpack-sw6-config",
3
3
  "public": true,
4
- "version": "7.4.2",
4
+ "version": "7.5.0",
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": "332a71bb95071a3c41d29daaaa815bf9809e6e7e",
24
+ "gitHead": "ce1a0dfc319927e3bc9462e460a0c32873471a5e",
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'),
@@ -23,17 +23,7 @@ const Path = require('path'),
23
23
  '',
24
24
  )}/administration/js/${pluginName}.js`;
25
25
  },
26
- },
27
- extractCssChunksConfig = {
28
- moduleFilename: ({ name }) => {
29
- let pluginName = name.replace('vendor-', '').toLowerCase();
30
- return `${pluginName.replace(
31
- /-/g,
32
- '',
33
- )}/administration/css/${pluginName}.css`;
34
- },
35
- hot: !isProd,
36
- };
26
+ }
37
27
 
38
28
  module.exports = {
39
29
  entry: () => {
@@ -197,7 +187,7 @@ module.exports = {
197
187
  },
198
188
  }),
199
189
 
200
- new ExtractCssChunks(extractCssChunksConfig),
190
+ new MiniCssExtractPlugin(),
201
191
  ],
202
192
 
203
193
  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,21 +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: false // set to false, so we can directly search for the asset url and replace it. sadly we need this for development - cdn works fine before
59
50
  },
60
51
  },
61
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
  };