Turbopack: Allow arrays to be used as values in `turbopack.rules` config (#83138)
This implements the last part of the syntax proposal in #82857.
We want to support this syntax:
```javascript
module.exports = {
turbopack: {
rules: {
// all matched rules apply, adding their loaders in order
'*.svg': [
// this optionally can be an array of objects (shown here), or just an object
{
// this condition is matched after the glob
condition: {
all: [
{ not: 'foreign' }, // excludes `node_modules`
{ path: /app\/.*\.svg/, content: /\<svg[^\>]*\>/ },
],
},
loaders: ['@svgr/webpack'],
as: '*.js',
},
],
},
},
}
```
Prior to this PR, the value of `'*.svg'` in the `turbopack.rules` object had to be a configuration object or an array of shorthand loader syntax. After this PR, it can be an array of "full" configuration objects.