@pixolith/webpack-sw6-config 8.0.4 → 8.1.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": "8.0.4",
4
+ "version": "8.1.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": "7725da79bfab658053a4e7251a67cfbdeb720f98",
24
+ "gitHead": "4bf80a9bd47a15e500ebd029f805d9abfdaa3fc6",
25
25
  "dependencies": {
26
26
  "@babel/cli": "7.23.4",
27
27
  "@babel/core": "^7.23.7",
@@ -35,7 +35,7 @@
35
35
  "@pixolith/webpack-assets-copy-plugin": "^8.0.0",
36
36
  "@pixolith/webpack-filename-linter-plugin": "^8.0.0",
37
37
  "@pixolith/webpack-hook-plugin": "^8.0.0",
38
- "@pixolith/webpack-twig-assets-emitter-plugin": "^8.0.3",
38
+ "@pixolith/webpack-sw6-plugin-map-emitter": "^8.1.1",
39
39
  "@pixolith/webpack-watcher": "^8.0.4",
40
40
  "@swc/core": "^1.7.0",
41
41
  "autoprefixer": "^10.4.14",
@@ -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
  },
@@ -194,6 +194,7 @@ module.exports = {
194
194
  svg: 'paramCase',
195
195
  },
196
196
  }),
197
+
197
198
  new TimeFixPlugin(),
198
199
 
199
200
  new webpack.DefinePlugin({
@@ -9,7 +9,7 @@ const Path = require('path'),
9
9
  isProd = process.env.NODE_ENV === 'production',
10
10
  ChangeCase = require('change-case'),
11
11
  Consola = require('consola'),
12
- TwigAssetEmitterPlugin = require('@pixolith/webpack-twig-assets-emitter-plugin'),
12
+ Sw6PluginMapEmitterPlugin = require('@pixolith/webpack-sw6-plugin-map-emitter'),
13
13
  Entry = require('webpack-glob-entry'),
14
14
  SvgStorePlugin = require('@pixolith/external-svg-sprite-loader'),
15
15
  publicPath = process.env.PUBLIC_PATH,
@@ -212,26 +212,10 @@ module.exports = {
212
212
  callback();
213
213
  },
214
214
  }),
215
- new TwigAssetEmitterPlugin({
215
+
216
+ new Sw6PluginMapEmitterPlugin({
216
217
  includes: ['js', 'css'],
217
218
  ignoreFiles: [/.*icons.*\.js/, /.*chunk.*\.js/],
218
- template: {
219
- 'scripts': {
220
- namespace: '@Storefront/storefront',
221
- path: '',
222
- filename: '_px_base.html.twig',
223
- },
224
- 'styles': {
225
- namespace: '@Storefront/storefront',
226
- path: 'layout',
227
- filename: '_px_meta.html.twig',
228
- },
229
- 'hints': {
230
- namespace: '@Storefront/storefront',
231
- path: 'layout',
232
- filename: '_px_meta.html.twig',
233
- },
234
- },
235
219
  }),
236
220
 
237
221
  new SvgStorePlugin({