@pixolith/webpack-sw6-config 8.0.3 → 8.0.5

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": "8.0.3",
4
+ "version": "8.0.5",
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": "81f89ced461e3191486452a5406a4ebdbd59c4c4",
24
+ "gitHead": "0c3e79d687f13c73dc4e802449d7c670f66a90db",
25
25
  "dependencies": {
26
26
  "@babel/cli": "7.23.4",
27
27
  "@babel/core": "^7.23.7",
@@ -36,7 +36,7 @@
36
36
  "@pixolith/webpack-filename-linter-plugin": "^8.0.0",
37
37
  "@pixolith/webpack-hook-plugin": "^8.0.0",
38
38
  "@pixolith/webpack-twig-assets-emitter-plugin": "^8.0.3",
39
- "@pixolith/webpack-watcher": "^8.0.0",
39
+ "@pixolith/webpack-watcher": "^8.0.4",
40
40
  "@swc/core": "^1.7.0",
41
41
  "autoprefixer": "^10.4.14",
42
42
  "babel-loader": "^9.1.2",
@@ -200,12 +200,11 @@ module.exports = {
200
200
  from: publicPath,
201
201
  to: '$pluginPath/$plugin/src/Resources/public',
202
202
  replace: async (fromPath, toPath) => {
203
- let pluginName = ChangeCase.pascalCase(
204
- Path.basename(fromPath).replace(
203
+ let composerPluginName = Path.basename(fromPath).replace(
205
204
  Path.extname(fromPath),
206
205
  '',
207
- ),
208
- );
206
+ ).replace('pxsw-', ''),
207
+ pluginName = ChangeCase.pascalCase(composerPluginName);
209
208
 
210
209
  let isPlugin = await Fs.existsSync(`custom/plugins/${pluginName}/src`),
211
210
  isStaticPlugin = await Fs.existsSync(`custom/static-plugins/${pluginName}/src`);
@@ -213,7 +212,13 @@ module.exports = {
213
212
  let pluginFolder = isPlugin ? 'custom/plugins' : (isStaticPlugin ? 'custom/static-plugins' : 'vendor/pxsw');
214
213
 
215
214
  toPath = toPath.replace('$pluginPath', pluginFolder);
216
- toPath = toPath.replace('$plugin', pluginName);
215
+ if (!isPlugin && !isStaticPlugin) {
216
+ let isDoublePxswPlugin = await Fs.existsSync(`vendor/pxsw/pxsw-${composerPluginName}/src`);
217
+ toPath = toPath.replace('$plugin', isDoublePxswPlugin ? `pxsw-${composerPluginName}` : composerPluginName);
218
+ } else {
219
+ toPath = toPath.replace('$plugin', pluginName);
220
+ }
221
+
217
222
  return toPath;
218
223
  },
219
224
  },