@putout/plugin-convert-webpack-to-rspack 1.0.1 → 1.0.2

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.
@@ -0,0 +1,9 @@
1
+ const rules = clean([{
2
+ test: /\.css$/,
3
+ use: [
4
+ 'style-loader',
5
+ 'css-loader',
6
+ 'clean-css-loader',
7
+ ],
8
+ }]);
9
+
@@ -11,6 +11,7 @@ const {
11
11
  objectProperty,
12
12
  isStringLiteral,
13
13
  isIdentifier,
14
+ isArrayExpression,
14
15
  } = types;
15
16
 
16
17
  const {insertAfter, remove} = operator;
@@ -59,7 +60,12 @@ export const traverse = ({push}) => ({
59
60
  if (!isUse(propertyUse))
60
61
  continue;
61
62
 
62
- const properties = propertyUse.get('value.properties').filter(isObjectProperty);
63
+ const valuePath = propertyUse.get('value');
64
+
65
+ if (isArrayExpression(valuePath))
66
+ continue;
67
+
68
+ const properties = valuePath.get('properties').filter(isObjectProperty);
63
69
 
64
70
  for (const property of properties) {
65
71
  if (!isUrlLoader(property))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-convert-webpack-to-rspack",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin to convert webpack config to rspack",