progress on migrating to heex templates and font-icons
This commit is contained in:
parent
d43daafdb7
commit
3eff955672
21793 changed files with 2161968 additions and 16895 deletions
421
assets_old/node_modules/webpack-merge/CHANGELOG.md
generated
vendored
Normal file
421
assets_old/node_modules/webpack-merge/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,421 @@
|
|||
# Changelog
|
||||
|
||||
## 5.7.3 / 2020-12-22
|
||||
|
||||
- Fix - Don't merge strings with objects in `mergeWithRules`. #172
|
||||
|
||||
## 5.7.2 / 2020-12-16
|
||||
|
||||
- Fix - If there's no match when using `merge` operation with `mergeWithRules`, use default merge behavior as a fallback. #167
|
||||
|
||||
## 5.7.1 / 2020-12-16
|
||||
|
||||
- Fix - Fix a merge failure for `mergeWithRules` when non-array matches are merged. #166
|
||||
|
||||
## 5.7.0 / 2020-12-12
|
||||
|
||||
- Feat - Throw a `TypeError` if trying to use `mergeWithRules` with invalid configuration types for `append`/`prepend`/`merge` operations.
|
||||
|
||||
## 5.6.1 / 2020-12-11
|
||||
|
||||
- Fix - Drop extraneous logging.
|
||||
|
||||
## 5.6.0 / 2020-12-11
|
||||
|
||||
- Feat - Support `merge` (`CustomizeRule.Merge`) for objects at `mergeWithRules`. This is useful for merging loader options for example. #163
|
||||
|
||||
## 5.5.0 / 2020-12-10
|
||||
|
||||
- Feat - Allow `mergeWithRules` to merge based on rules without a match. #151 #159
|
||||
|
||||
## 5.4.1 / 2020-12-08
|
||||
|
||||
- Fix - Allow `mergeUnique` to work with arbitrary order. #161
|
||||
|
||||
## 5.4.0 / 2020-10-30
|
||||
|
||||
- Fix - Fall back correctly in `mergeWithRules` for cases that aren't matched. #157 #158
|
||||
- Fix - Don't throw if using `mergeWithRules` without a rule #151
|
||||
- Feat - Throw if `undefined` is passed to `merge` as a structure to merge
|
||||
|
||||
## 5.3.0 / 2020-10-30
|
||||
|
||||
- Fix - Expose `Configuration` type through a generic to TypeScript to support both webpack 4 and 5 #141 #154
|
||||
|
||||
In case you use webpack 4, please change your typing as instructed in the readme as the default type is loose but non-breaking.
|
||||
|
||||
## 5.2.0 / 2020-10-07
|
||||
|
||||
- Feature - Support advanced merging cases through `mergeWithRules` #146 #149
|
||||
|
||||
## 5.1.4 / 2020-09-09
|
||||
|
||||
- Fix - Expose `CustomizeRule` for TypeScript users #147
|
||||
|
||||
## 5.1.3 / 2020-08-30
|
||||
|
||||
- Fix - Allow merging a `RegExp` to itself #145
|
||||
|
||||
## 5.1.2 / 2020-08-18
|
||||
|
||||
- Fix - Allow overriding an object field with `null` #144
|
||||
|
||||
## 5.1.1 / 2020-08-04
|
||||
|
||||
- Fix - Drop `<reference types="webpack-dev-server" />` from **index.d.ts** #143
|
||||
|
||||
## 5.1.0 / 2020-08-03
|
||||
|
||||
- Feature - Expose `merge` as `default` for backwards-compatibility with TypeScript. Now `import merge from "webpack-merge";` works there. In CommonJS, the default alias is exposed through `default` property due to technical constraints.
|
||||
|
||||
## 5.0.9 / 2020-07-09
|
||||
|
||||
- Fix - Don't crash on `merge()` and `merge([])`. Now `{}` is returned in these corner cases.
|
||||
|
||||
## 5.0.8 / 2020-07-07
|
||||
|
||||
- Fix - Support Node 10 #138
|
||||
|
||||
## 5.0.7 / 2020-07-06
|
||||
|
||||
- Fix - Drop tslib dependency by setting `"importHelpers": false,`
|
||||
|
||||
## 5.0.6 / 2020-07-06
|
||||
|
||||
- Fix - Add tslib to dependencies
|
||||
|
||||
## 5.0.5 / 2020-07-06
|
||||
|
||||
- Tech - Optimize build size (UMD isn't needed)
|
||||
|
||||
## 5.0.4 / 2020-07-06
|
||||
|
||||
- Documentation - Use CommonJS imports at the examples. #137
|
||||
|
||||
## 5.0.3 / 2020-07-06
|
||||
|
||||
- Feature - Support TypeScript out of the box. #84 #86 #95 #110 #112
|
||||
- Deprecation - `merge.smart` has been dropped as it's tricky to support all the corner cases. Instead, it's better to use the provided utilities to put together a `merge` that fits your case.
|
||||
- Deprecation - `mergeStrategy` has been dropped in favor of using `mergeWithCustomize` with `customizeArray` and `customizeObject`.
|
||||
- Deprecation - `merge.multiple` has been dropped as the functionality was too specific and it's better to implement in the user space if needed.
|
||||
- Breaking - `merge` has been moved as a regular import (i.e. `import { merge } from 'webpack-merge'`).
|
||||
- Breaking - Merge customization has been moved behind `mergeWithCustomize`.
|
||||
- Breaking - Bump supported Node version to 12
|
||||
- Feature - `customizeArray` supports wildcards now. Example: `'entry.*': 'prepend'`. #45 #99
|
||||
- Feature - Throw an error in case a `Promise` is being merged. It's better to wrap configuration within a `Promise` and merge inside it. #81
|
||||
- Fix - Drop lodash in favor of simpler dependencies. #134
|
||||
- Fix - Make `unique` merge from right to left to match behavior elsewhere. #119
|
||||
- Fix - Make sure `unique` doesn't lose non-unique items to merge. #125
|
||||
|
||||
Special thanks to Google and Addy Osmani for supporting the work financially as it allowed me to complete the work required by the new major release.
|
||||
|
||||
## 4.2.2 / 2019-08-27
|
||||
|
||||
- Fix - Update minimum version of lodash to 4.17.15 in order to avoid `npm audit warning`. #116
|
||||
- Docs - Improve `merge.unique` documentation. #103
|
||||
- Docs - Add clear note about precedence. #115
|
||||
|
||||
## 4.2.1 / 2019-01-04
|
||||
|
||||
- Feature - Support `oneOf` at `merge.smart`. #111
|
||||
- Fix - If there's only single array to merge, clone it. #106
|
||||
|
||||
## 4.1.4 / 2018-08-01
|
||||
|
||||
- Maintenance - Remove bitHound from the README as it closed down. #102
|
||||
|
||||
## 4.1.3 / 2018-06-14
|
||||
|
||||
- Fix - Smart merge respects the existing loader order #79, #101
|
||||
|
||||
## 4.1.2 / 2017-02-22
|
||||
|
||||
- Maintenance - Update lodash, #97, #98
|
||||
|
||||
## 4.1.1 / 2017-11-01
|
||||
|
||||
- Docs - Add `customizeArray` and `customizeObject` examples. #93
|
||||
|
||||
## 4.1.0 / 2017-03-16
|
||||
|
||||
- Feature - `merge.multiple` to allow working with webpack multi-compiler mode. It accepts multiple objects and returns an array you can push to webpack. #74
|
||||
|
||||
## 4.0.0 / 2017-03-06
|
||||
|
||||
- Breaking feature - `merge.smart` allows re-ordering loaders like below. #70
|
||||
|
||||
```javascript
|
||||
merge.smart(
|
||||
{
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loaders: ["babel"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loaders: ["react-hot", "babel"],
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
// will become
|
||||
{
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
// order of second argument is respected
|
||||
loaders: ["react-hot", "babel"],
|
||||
},
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
## 3.0.0 / 2017-02-19
|
||||
|
||||
- Breaking fix - `merge.smart` should not merge a child missing `include`/`exclude` to a parent that has either. This is safer and more predictable behavior than the old one. #69
|
||||
|
||||
## 2.6.1 / 2017-01-29
|
||||
|
||||
- Bug fix - `merge.smart` should not merge rules that have differing `enforce` fields. #65
|
||||
|
||||
## 2.6.0 / 2017-01-27
|
||||
|
||||
- Bug fix - Support `replace` mode for `merge.smartStrategy`. #63
|
||||
|
||||
## 2.5.0 / 2017-01-26
|
||||
|
||||
- Bug fix - Make sure `merge.smartStrategy` works with higher level nesting like `'module.rules.use': 'prepend'`. #64
|
||||
|
||||
## 2.4.0 / 2017-01-12
|
||||
|
||||
- Feature - Add `merge.unique` helper that plugs into `customizeArray`. This allows you to force only one plugin of a type to the end result. #58
|
||||
|
||||
## 2.3.1 / 2017-01-06
|
||||
|
||||
- Bug fix - Clear up `CopyWebpackPlugin` handling. #56
|
||||
|
||||
## 2.3.0 / 2017-01-06
|
||||
|
||||
- Refactor - Depend only on `lodash` instead of individual packages as latter has been discontinued. #52
|
||||
|
||||
## 2.2.0 / 2017-01-05
|
||||
|
||||
- Bug fix - Drop `merge.smartStrategy(rules, plugins)` as that caused other issues (prototype copying for complex cases). That needs a better approach. #55
|
||||
|
||||
## 2.1.1 / 2017-01-05
|
||||
|
||||
- Bug fix - Avoid recursion at `merge.smart`. #53
|
||||
|
||||
## 2.1.0 / 2017-01-05
|
||||
|
||||
- Feature - Allow `merge.smartStrategy` to merge plugin contents. API: `merge.smartStrategy(rules, plugins)`. #44. Example:
|
||||
|
||||
```javascript
|
||||
const output = merge.smartStrategy(
|
||||
{
|
||||
entry: 'prepend', // or 'replace'
|
||||
'module.loaders': 'prepend'
|
||||
},
|
||||
['LoaderOptionsPlugin']
|
||||
)(object1, object2, object3, ...);
|
||||
```
|
||||
|
||||
## 2.0.0 / 2016-12-22
|
||||
|
||||
- Breaking - Disallow overriding configuration with empty arrays/objects (#48). If you want to override, use `merge.strategy`. Example:
|
||||
|
||||
```javascript
|
||||
const a = {
|
||||
entry: ["foo"],
|
||||
};
|
||||
const b = {
|
||||
entry: [],
|
||||
};
|
||||
|
||||
merge(a, b); // Yields a result, not b like before.
|
||||
```
|
||||
|
||||
## 1.1.2 / 2016-12-18
|
||||
|
||||
- Bug fix - `merge({ entry: {} })` should return the same result as input instead of a function.
|
||||
|
||||
## 1.1.1 / 2016-12-11
|
||||
|
||||
- Bug fix - Support previously undocumented, yet used, `merge([<object>])` format. This works with all available functions. #46
|
||||
|
||||
## 1.1.0 / 2016-12-09
|
||||
|
||||
- Feature - Allow `merge` behavior to be customized with overrides. Example:
|
||||
|
||||
```javascript
|
||||
var output = merge({
|
||||
customizeArray(a, b, key) { return [...a, ...b]; },
|
||||
customizeObject(a, b, key) { return mergeWith(a, b); }
|
||||
})(object1, object2, object3, ...);
|
||||
```
|
||||
|
||||
This allows you to guarantee array uniqueness and so on.
|
||||
|
||||
## 1.0.2 / 2016-11-29
|
||||
|
||||
- Bug fix - `merge` should not mutate inputs with mismatched keys.
|
||||
|
||||
## 1.0.0 / 2016-11-28
|
||||
|
||||
- Feature: Support merging Webpack 2 Rule.use. #38
|
||||
- Bug fix - Don't concat loaders if the first matching entry's include/exclude doesn't match. #39
|
||||
|
||||
## 0.20.0 / 2016-11-27
|
||||
|
||||
- Feature: Add support for merging functions. This feature has been designed `postcss` in mind. It executes the functions, picks their results, and packs them again.
|
||||
|
||||
## 0.19.0 / 2016-11-26
|
||||
|
||||
- Feature: Add support for 'replace' option at `merge.strategy`. It literally replaces the old field value with the newer one. #40
|
||||
|
||||
## 0.18.0 / 2016-11-24
|
||||
|
||||
- Feature: Add support for recursive definitions at `merge.strategy`. Example:
|
||||
|
||||
```javascript
|
||||
var output = merge.strategy({
|
||||
entry: 'prepend',
|
||||
'module.loaders': 'prepend'
|
||||
})(object1, object2, object3, ...);
|
||||
```
|
||||
|
||||
- Feature: Add `merge.smartStrategy`. This combines the ideas of `merge.smart` and `merge.strategy` into one. Example:
|
||||
|
||||
```javascript
|
||||
var output = merge.smartStrategy({
|
||||
entry: 'prepend',
|
||||
'module.loaders': 'prepend'
|
||||
})(object1, object2, object3, ...);
|
||||
```
|
||||
|
||||
## 0.17.0 / 2016-11-16
|
||||
|
||||
- Feature: Add support for `merge.strategy`. Now you can customize merging behavior per root level configuration field. Example: `merge.strategy({ entry: 'prepend' })(object1, object2, object3, ...);`. #17
|
||||
|
||||
## 0.16.0 / 2016-11-14
|
||||
|
||||
- Feature: Add support for webpack 2 at `merge.smart`. It should pick up `module.rules` as you might expect now. #35
|
||||
|
||||
## 0.15.0 / 2016-10-18
|
||||
|
||||
- Breaking: Rework `merge.smart` so that it **appends** loaders instead of **prepending** them. This is the logical thing to do as it allows you to specify behavior better as you `merge`. #32
|
||||
|
||||
## 0.14.1 / 2016-07-25
|
||||
|
||||
- Docs: Improve package description. #23.
|
||||
- Bug fix - Let `merge.smart` merge loaders based on their full name instead of first letter. Thanks to @choffmeister. #26.
|
||||
|
||||
## 0.14.0 / 2016-06-05
|
||||
|
||||
- Feature: Allow `merge.smart` to merge `loaders` if `exclude` is the same. Thanks to @mshwery. #21.
|
||||
|
||||
## 0.13.0 / 2016-05-24
|
||||
|
||||
- Bug fix: Allow `merge.smart` to merge configuration if `include` is defined. Thanks to @blackrabbit99. #20.
|
||||
|
||||
## 0.12.0 / 2016-04-19
|
||||
|
||||
- Feature: Support `include/exclude` at `merge.smart` for `loader` definition too. Thanks to @Whoaa512. #16.
|
||||
|
||||
## 0.11.0 / 2016-04-18
|
||||
|
||||
- Feature: Support `include/exclude` at `merge.smart` when its set only in a parent. #15.
|
||||
|
||||
## 0.10.0 / 2016-04-10
|
||||
|
||||
- Feature: Support `include/exclude` at `merge.smart`. Thanks to @siready. #14.
|
||||
|
||||
## 0.9.0 / 2016-04-08
|
||||
|
||||
- Feature: Allow existing objects/arrays to be emptied with an empty object/array later in merge. This overriding behavior is useful for example emptying your `entry` configuration.
|
||||
|
||||
## 0.8.4 / 2016-03-17
|
||||
|
||||
- Bug fix: _webpack-merge_ should not mutate inputs. #12
|
||||
|
||||
## 0.8.3 / 2016-03-02
|
||||
|
||||
- Bug fix: Drop `files` field from _package.json_ as it wasn't including the dist correctly.
|
||||
|
||||
## 0.8.0 / 2016-03-02
|
||||
|
||||
- Breaking: Change merging behavior so that only loaders get prepended. The rest follow appending logic. This makes `entry` array merging behavior logical. Prepend makes sense only for loaders after all. #10
|
||||
|
||||
## 0.7.3 / 2016-01-11
|
||||
|
||||
- Bug fix: Do not error when there are no matching loaders. Thanks @GreenGremlin!
|
||||
|
||||
## 0.7.2 / 2016-01-08
|
||||
|
||||
- Regenerate tarball. The problem was that there were some old dependencies included. Closes #7.
|
||||
|
||||
## 0.7.1 / 2016-01-03
|
||||
|
||||
- Improve performance by defaulting to `concat` and by dropping a redundant check. Thanks @davegomez!
|
||||
|
||||
## 0.7.0 / 2015-12-31
|
||||
|
||||
- Bug fix: Arrays get merged within nested structures correctly now. Array items are prepended (reverse order compared to earlier). This is related to the change made in _0.6.0_. Incidentally this change affects normal merge as well.
|
||||
- Smart merge: If a loader contains either `include` or `exclude`, it will generate separate entries instead of merging. Without this the configuration might change in an unpredictable manner.
|
||||
|
||||
## 0.6.0 / 2015-12-30
|
||||
|
||||
- Support `preLoaders` and `postLoaders`. Previously only `loaders` were supported.
|
||||
- Breaking: Change smart merging behavior for `loaders` field so that it prepends loaders instead of appending them. The benefit of this is that now it's possible to specialize loader setup in a predictable manner. For example you can have a linter set up at the root and expect it to become evaluated first always.
|
||||
|
||||
## 0.5.1 / 2015-12-26
|
||||
|
||||
- Fix `merge` object/array case (missing `bind`). The behavior should be correct now.
|
||||
|
||||
## 0.5.0 / 2015-12-26
|
||||
|
||||
- Breaking: Push smart merging behind `merge.smart`. Now `merge` behaves exactly as in _0.3.0_ series.
|
||||
|
||||
## 0.4.0 / 2015-12-23
|
||||
|
||||
- Dropped changelog generator. It's better to write these by hand.
|
||||
- Breaking: Added smart merging (@GreenGremlin)
|
||||
|
||||
## 0.3.2 / 2015-11-23
|
||||
|
||||
- Tweaked changelog generator process.
|
||||
|
||||
## 0.3.1 / 2015-11-23
|
||||
|
||||
- Added changelog generator.
|
||||
|
||||
## 0.3.0 / 2015-11-13
|
||||
|
||||
- Improved formatting
|
||||
- Allowed an arbitrary amount of objects to be merged
|
||||
|
||||
## 0.2.0 / 2015-08-30
|
||||
|
||||
- Only require lodash modules used by the package (@montogeek)
|
||||
- Removed lodash.isarray dependency, use Array.isArray standard object
|
||||
|
||||
## 0.1.3 / 2015-08-10
|
||||
|
||||
- Improved README example
|
||||
|
||||
## 0.1.2 / 2015-07-01
|
||||
|
||||
- Simplified example
|
||||
|
||||
## 0.1.1 / 2015-06-26
|
||||
|
||||
- Fixed travis link
|
||||
|
||||
## 0.1.0 / 2015-06-26
|
||||
|
||||
- Initial implementation
|
20
assets_old/node_modules/webpack-merge/LICENSE
generated
vendored
Normal file
20
assets_old/node_modules/webpack-merge/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
Copyright (c) 2015 Juho Vepsalainen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
314
assets_old/node_modules/webpack-merge/README.md
generated
vendored
Normal file
314
assets_old/node_modules/webpack-merge/README.md
generated
vendored
Normal file
|
@ -0,0 +1,314 @@
|
|||
[](https://opencollective.com/webpack-merge) [](http://travis-ci.org/survivejs/webpack-merge) [](https://codecov.io/gh/survivejs/webpack-merge)
|
||||
|
||||
# webpack-merge - Merge designed for Webpack
|
||||
|
||||
**webpack-merge** provides a `merge` function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will execute them, run the results through the algorithm, and then wrap the returned values within a function again.
|
||||
|
||||
This behavior is particularly useful in configuring webpack although it has uses beyond it. Whenever you need to merge configuration objects, **webpack-merge** can come in handy.
|
||||
|
||||
## **`merge(...configuration | [...configuration])`**
|
||||
|
||||
`merge` is the core, and the most important idea, of the API. Often this is all you need unless you want further customization.
|
||||
|
||||
```javascript
|
||||
const { merge } = require('webpack-merge');
|
||||
|
||||
// Default API
|
||||
const output = merge(object1, object2, object3, ...);
|
||||
|
||||
// You can pass an array of objects directly.
|
||||
// This works with all available functions.
|
||||
const output = merge([object1, object2, object3]);
|
||||
|
||||
// Keys matching to the right take precedence:
|
||||
const output = merge(
|
||||
{ fruit: "apple", color: "red" },
|
||||
{ fruit: "strawberries" }
|
||||
);
|
||||
console.log(output);
|
||||
// { color: "red", fruit: "strawberries"}
|
||||
```
|
||||
|
||||
### Limitations
|
||||
|
||||
Note that `Promise`s are not supported! If you want to return a configuration wrapped within a `Promise`, `merge` inside one. Example: `Promise.resolve(merge({ ... }, { ... }))`.
|
||||
|
||||
The same goes for configuration level functions as in the example below:
|
||||
|
||||
**webpack.config.js**
|
||||
|
||||
```javascript
|
||||
const commonConfig = { ... };
|
||||
|
||||
const productionConfig = { ... };
|
||||
|
||||
const developmentConfig = { ... };
|
||||
|
||||
module.exports = env => {
|
||||
switch(env) {
|
||||
case 'development':
|
||||
return merge(commonConfig, developmentConfig);
|
||||
case 'production':
|
||||
return merge(commonConfig, productionConfig);
|
||||
default:
|
||||
throw new Error('No matching configuration was found!');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can choose the configuration you want by using `webpack --env development` assuming you are using _webpack-cli_.
|
||||
|
||||
## **`mergeWithCustomize({ customizeArray, customizeObject })(...configuration | [...configuration])`**
|
||||
|
||||
In case you need more flexibility, `merge` behavior can be customized per field as below:
|
||||
|
||||
```javascript
|
||||
const { mergeWithCustomize } = require('webpack-merge');
|
||||
|
||||
const output = mergeWithCustomize(
|
||||
{
|
||||
customizeArray(a, b, key) {
|
||||
if (key === 'extensions') {
|
||||
return _.uniq([...a, ...b]);
|
||||
}
|
||||
|
||||
// Fall back to default merging
|
||||
return undefined;
|
||||
},
|
||||
customizeObject(a, b, key) {
|
||||
if (key === 'module') {
|
||||
// Custom merging
|
||||
return _.merge({}, a, b);
|
||||
}
|
||||
|
||||
// Fall back to default merging
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
)(object1, object2, object3, ...);
|
||||
```
|
||||
|
||||
For example, if the previous code was invoked with only `object1` and `object2`
|
||||
with `object1` as:
|
||||
|
||||
```javascript
|
||||
{
|
||||
foo1: ['object1'],
|
||||
foo2: ['object1'],
|
||||
bar1: { object1: {} },
|
||||
bar2: { object1: {} },
|
||||
}
|
||||
```
|
||||
|
||||
and `object2` as:
|
||||
|
||||
```javascript
|
||||
{
|
||||
foo1: ['object2'],
|
||||
foo2: ['object2'],
|
||||
bar1: { object2: {} },
|
||||
bar2: { object2: {} },
|
||||
}
|
||||
```
|
||||
|
||||
then `customizeArray` will be invoked for each property of `Array` type, i.e:
|
||||
|
||||
```javascript
|
||||
customizeArray(["object1"], ["object2"], "foo1");
|
||||
customizeArray(["object1"], ["object2"], "foo2");
|
||||
```
|
||||
|
||||
and `customizeObject` will be invoked for each property of `Object` type, i.e:
|
||||
|
||||
```javascript
|
||||
customizeObject({ object1: {} }, { object2: {} }, bar1);
|
||||
customizeObject({ object1: {} }, { object2: {} }, bar2);
|
||||
```
|
||||
|
||||
## **`customizeArray`** and **`customizeObject`**
|
||||
|
||||
`customizeArray` and `customizeObject` provide small strategies to for `mergeWithCustomize`. They support `append`, `prepend`, `replace`, and wildcards for field names.
|
||||
|
||||
```javascript
|
||||
const { mergeWithCustomize, customizeArray, customizeObject } = require('webpack-merge');
|
||||
|
||||
const output = mergeWithCustomize({
|
||||
customizeArray: customizeArray({
|
||||
'entry.*': 'prepend'
|
||||
}),
|
||||
customizeObject: customizeObject({
|
||||
entry: 'prepend'
|
||||
})
|
||||
})(object1, object2, object3, ...);
|
||||
```
|
||||
|
||||
## **`unique(<field>, <fields>, field => field)`**
|
||||
|
||||
`unique` is a strategy used for forcing uniqueness within configuration. It's most useful with plugins when you want to make sure there's only one in place.
|
||||
|
||||
The first `<field>` is the config property to look through for duplicates.
|
||||
|
||||
`<fields>` represents the values that should be unique when you run the field => field function on each duplicate.
|
||||
|
||||
When the order of elements of the `<field>` in the first configuration differs from the order in the second configuration, the latter is preserved.
|
||||
|
||||
```javascript
|
||||
const { mergeWithCustomize, unique } = require("webpack-merge");
|
||||
|
||||
const output = mergeWithCustomize({
|
||||
customizeArray: unique(
|
||||
"plugins",
|
||||
["HotModuleReplacementPlugin"],
|
||||
(plugin) => plugin.constructor && plugin.constructor.name
|
||||
),
|
||||
})(
|
||||
{
|
||||
plugins: [new webpack.HotModuleReplacementPlugin()],
|
||||
},
|
||||
{
|
||||
plugins: [new webpack.HotModuleReplacementPlugin()],
|
||||
}
|
||||
);
|
||||
|
||||
// Output contains only single HotModuleReplacementPlugin now and it's
|
||||
// going to be the last plugin instance.
|
||||
```
|
||||
|
||||
## **`mergeWithRules`**
|
||||
|
||||
To support advanced merging needs (i.e. merging within loaders), `mergeWithRules` includes additional syntax that allows you to match fields and apply strategies to match. Consider the full example below:
|
||||
|
||||
```javascript
|
||||
const a = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [{ loader: "style-loader" }, { loader: "sass-loader" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
const b = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
{
|
||||
loader: "style-loader",
|
||||
options: {
|
||||
modules: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
const result = {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
{
|
||||
loader: "style-loader",
|
||||
options: {
|
||||
modules: true,
|
||||
},
|
||||
},
|
||||
{ loader: "sass-loader" },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
assert.deepStrictEqual(
|
||||
mergeWithRules({
|
||||
module: {
|
||||
rules: {
|
||||
test: "match",
|
||||
use: {
|
||||
loader: "match",
|
||||
options: "replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
})(a, b),
|
||||
result
|
||||
);
|
||||
```
|
||||
|
||||
The way it works is that you should annotate fields to match using `match` (or `CustomizeRule.Match` if you are using TypeScript) matching your configuration structure and then use specific strategies to define how particular fields should be transformed. If a match doesn't exist above a rule, then it will apply the rule automatically.
|
||||
|
||||
**Supported annotations:**
|
||||
|
||||
- `match` (`CustomizeRule.Match`) - Optional matcher that scopes merging behavior to a specific part based on similarity (think DOM or jQuery selectors)
|
||||
- `append` (`CustomizeRule.Append`) - Appends items
|
||||
- `prepend` (`CustomizeRule.Prepend`) - Prepends items
|
||||
- `replace` (`CustomizeRule.Replace`) - Replaces items
|
||||
- `merge` (`CustomizeRule.Merge`) - Merges objects (shallow merge)
|
||||
|
||||
## Using with TypeScript
|
||||
|
||||
**webpack-merge** supports TypeScript out of the box. You should pass `Configuration` type from webpack to it as follows:
|
||||
|
||||
```typescript
|
||||
import { Configuration } from "webpack";
|
||||
import { merge } from "webpack-merge";
|
||||
|
||||
const config = merge<Configuration>({...}, {...});
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
1. `nvm use`
|
||||
1. `npm i`
|
||||
1. `npm run build -- --watch` in one terminal
|
||||
1. `npm t -- --watch` in another one
|
||||
|
||||
Before contributing, please [open an issue](https://github.com/survivejs/webpack-merge/issues/new) where to discuss.
|
||||
|
||||
## Further Information and Support
|
||||
|
||||
Check out [SurviveJS - Webpack 5](http://survivejs.com/) to dig deeper into webpack. The free book uses **webpack-merge** extensively and shows you how to compose your configuration to keep it maintainable.
|
||||
|
||||
I am also available as a consultant in case you require specific assistance. I can contribute particularly in terms of improving maintainability of the setup while speeding it up and pointing out better practices. In addition to improving developer productivity, the work has impact on the end users of the product in terms of reduced application size and loading times.
|
||||
|
||||
## Contributors
|
||||
|
||||
### Code Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
<a href="https://github.com/survivejs/webpack-merge/graphs/contributors"><img src="https://opencollective.com/webpack-merge/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
### Financial Contributors
|
||||
|
||||
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/webpack-merge/contribute)]
|
||||
|
||||
#### Individuals
|
||||
|
||||
<a href="https://opencollective.com/webpack-merge"><img src="https://opencollective.com/webpack-merge/individuals.svg?width=890"></a>
|
||||
|
||||
#### Organizations
|
||||
|
||||
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/webpack-merge/contribute)]
|
||||
|
||||
<a href="https://opencollective.com/webpack-merge/organization/0/website"><img src="https://opencollective.com/webpack-merge/organization/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/1/website"><img src="https://opencollective.com/webpack-merge/organization/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/2/website"><img src="https://opencollective.com/webpack-merge/organization/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/3/website"><img src="https://opencollective.com/webpack-merge/organization/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/4/website"><img src="https://opencollective.com/webpack-merge/organization/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/5/website"><img src="https://opencollective.com/webpack-merge/organization/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/6/website"><img src="https://opencollective.com/webpack-merge/organization/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/7/website"><img src="https://opencollective.com/webpack-merge/organization/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/8/website"><img src="https://opencollective.com/webpack-merge/organization/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/webpack-merge/organization/9/website"><img src="https://opencollective.com/webpack-merge/organization/9/avatar.svg"></a>
|
||||
|
||||
## License
|
||||
|
||||
**webpack-merge** is available under MIT. See LICENSE for more details.
|
15
assets_old/node_modules/webpack-merge/dist/index.d.ts
generated
vendored
Normal file
15
assets_old/node_modules/webpack-merge/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
import unique from "./unique";
|
||||
import { CustomizeRule, ICustomizeOptions, Key } from "./types";
|
||||
declare function merge<Configuration extends object>(firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]): Configuration;
|
||||
declare function mergeWithCustomize<Configuration extends object>(options: ICustomizeOptions): (firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration;
|
||||
declare function customizeArray(rules: {
|
||||
[s: string]: CustomizeRule;
|
||||
}): (a: any, b: any, key: Key) => any;
|
||||
declare type Rules = {
|
||||
[s: string]: CustomizeRule | Rules;
|
||||
};
|
||||
declare function mergeWithRules(rules: Rules): (firstConfiguration: object | object[], ...configurations: object[]) => object;
|
||||
declare function customizeObject(rules: {
|
||||
[s: string]: CustomizeRule;
|
||||
}): (a: any, b: any, key: Key) => any;
|
||||
export { customizeArray, customizeObject, CustomizeRule, merge, merge as default, mergeWithCustomize, mergeWithRules, unique, };
|
262
assets_old/node_modules/webpack-merge/dist/index.js
generated
vendored
Normal file
262
assets_old/node_modules/webpack-merge/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,262 @@
|
|||
"use strict";
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spread = (this && this.__spread) || function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
exports.__esModule = true;
|
||||
exports.unique = exports.mergeWithRules = exports.mergeWithCustomize = exports["default"] = exports.merge = exports.CustomizeRule = exports.customizeObject = exports.customizeArray = void 0;
|
||||
var wildcard_1 = __importDefault(require("wildcard"));
|
||||
var merge_with_1 = __importDefault(require("./merge-with"));
|
||||
var join_arrays_1 = __importDefault(require("./join-arrays"));
|
||||
var unique_1 = __importDefault(require("./unique"));
|
||||
exports.unique = unique_1["default"];
|
||||
var types_1 = require("./types");
|
||||
exports.CustomizeRule = types_1.CustomizeRule;
|
||||
var utils_1 = require("./utils");
|
||||
function merge(firstConfiguration) {
|
||||
var configurations = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
configurations[_i - 1] = arguments[_i];
|
||||
}
|
||||
return mergeWithCustomize({}).apply(void 0, __spread([firstConfiguration], configurations));
|
||||
}
|
||||
exports.merge = merge;
|
||||
exports["default"] = merge;
|
||||
function mergeWithCustomize(options) {
|
||||
return function mergeWithOptions(firstConfiguration) {
|
||||
var configurations = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
configurations[_i - 1] = arguments[_i];
|
||||
}
|
||||
if (utils_1.isUndefined(firstConfiguration) || configurations.some(utils_1.isUndefined)) {
|
||||
throw new TypeError("Merging undefined is not supported");
|
||||
}
|
||||
// @ts-ignore
|
||||
if (firstConfiguration.then) {
|
||||
throw new TypeError("Promises are not supported");
|
||||
}
|
||||
// No configuration at all
|
||||
if (!firstConfiguration) {
|
||||
return {};
|
||||
}
|
||||
if (configurations.length === 0) {
|
||||
if (Array.isArray(firstConfiguration)) {
|
||||
// Empty array
|
||||
if (firstConfiguration.length === 0) {
|
||||
return {};
|
||||
}
|
||||
if (firstConfiguration.some(utils_1.isUndefined)) {
|
||||
throw new TypeError("Merging undefined is not supported");
|
||||
}
|
||||
// @ts-ignore
|
||||
if (firstConfiguration[0].then) {
|
||||
throw new TypeError("Promises are not supported");
|
||||
}
|
||||
return merge_with_1["default"](firstConfiguration, join_arrays_1["default"](options));
|
||||
}
|
||||
return firstConfiguration;
|
||||
}
|
||||
return merge_with_1["default"]([firstConfiguration].concat(configurations), join_arrays_1["default"](options));
|
||||
};
|
||||
}
|
||||
exports.mergeWithCustomize = mergeWithCustomize;
|
||||
function customizeArray(rules) {
|
||||
return function (a, b, key) {
|
||||
var matchedRule = Object.keys(rules).find(function (rule) { return wildcard_1["default"](rule, key); }) || "";
|
||||
if (matchedRule) {
|
||||
switch (rules[matchedRule]) {
|
||||
case types_1.CustomizeRule.Prepend:
|
||||
return __spread(b, a);
|
||||
case types_1.CustomizeRule.Replace:
|
||||
return b;
|
||||
case types_1.CustomizeRule.Append:
|
||||
default:
|
||||
return __spread(a, b);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.customizeArray = customizeArray;
|
||||
function mergeWithRules(rules) {
|
||||
return mergeWithCustomize({
|
||||
customizeArray: function (a, b, key) {
|
||||
var currentRule = rules;
|
||||
key.split(".").forEach(function (k) {
|
||||
if (!currentRule) {
|
||||
return;
|
||||
}
|
||||
currentRule = currentRule[k];
|
||||
});
|
||||
if (utils_1.isPlainObject(currentRule)) {
|
||||
return mergeWithRule({ currentRule: currentRule, a: a, b: b });
|
||||
}
|
||||
if (typeof currentRule === "string") {
|
||||
return mergeIndividualRule({ currentRule: currentRule, a: a, b: b });
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.mergeWithRules = mergeWithRules;
|
||||
var isArray = Array.isArray;
|
||||
function mergeWithRule(_a) {
|
||||
var currentRule = _a.currentRule, a = _a.a, b = _a.b;
|
||||
if (!isArray(a)) {
|
||||
return a;
|
||||
}
|
||||
var bAllMatches = [];
|
||||
var ret = a.map(function (ao) {
|
||||
if (!utils_1.isPlainObject(currentRule)) {
|
||||
return ao;
|
||||
}
|
||||
var ret = {};
|
||||
var rulesToMatch = [];
|
||||
var operations = {};
|
||||
Object.entries(currentRule).forEach(function (_a) {
|
||||
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
||||
if (v === types_1.CustomizeRule.Match) {
|
||||
rulesToMatch.push(k);
|
||||
}
|
||||
else {
|
||||
operations[k] = v;
|
||||
}
|
||||
});
|
||||
var bMatches = b.filter(function (o) {
|
||||
var matches = rulesToMatch.every(function (rule) { var _a, _b; return ((_a = ao[rule]) === null || _a === void 0 ? void 0 : _a.toString()) === ((_b = o[rule]) === null || _b === void 0 ? void 0 : _b.toString()); });
|
||||
if (matches) {
|
||||
bAllMatches.push(o);
|
||||
}
|
||||
return matches;
|
||||
});
|
||||
if (!utils_1.isPlainObject(ao)) {
|
||||
return ao;
|
||||
}
|
||||
Object.entries(ao).forEach(function (_a) {
|
||||
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
||||
var rule = currentRule;
|
||||
switch (currentRule[k]) {
|
||||
case types_1.CustomizeRule.Match:
|
||||
ret[k] = v;
|
||||
Object.entries(rule).forEach(function (_a) {
|
||||
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
||||
if (v === types_1.CustomizeRule.Replace && bMatches.length > 0) {
|
||||
var val = last(bMatches)[k];
|
||||
if (typeof val !== "undefined") {
|
||||
ret[k] = val;
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case types_1.CustomizeRule.Append:
|
||||
if (!bMatches.length) {
|
||||
ret[k] = v;
|
||||
break;
|
||||
}
|
||||
var appendValue = last(bMatches)[k];
|
||||
if (!isArray(v) || !isArray(appendValue)) {
|
||||
throw new TypeError("Trying to append non-arrays");
|
||||
}
|
||||
ret[k] = v.concat(appendValue);
|
||||
break;
|
||||
case types_1.CustomizeRule.Merge:
|
||||
if (!bMatches.length) {
|
||||
ret[k] = v;
|
||||
break;
|
||||
}
|
||||
var lastValue = last(bMatches)[k];
|
||||
if (!utils_1.isPlainObject(v) || !utils_1.isPlainObject(lastValue)) {
|
||||
throw new TypeError("Trying to merge non-objects");
|
||||
}
|
||||
// @ts-ignore: These should be objects now
|
||||
ret[k] = __assign(__assign({}, v), lastValue);
|
||||
break;
|
||||
case types_1.CustomizeRule.Prepend:
|
||||
if (!bMatches.length) {
|
||||
ret[k] = v;
|
||||
break;
|
||||
}
|
||||
var prependValue = last(bMatches)[k];
|
||||
if (!isArray(v) || !isArray(prependValue)) {
|
||||
throw new TypeError("Trying to prepend non-arrays");
|
||||
}
|
||||
ret[k] = prependValue.concat(v);
|
||||
break;
|
||||
case types_1.CustomizeRule.Replace:
|
||||
ret[k] = bMatches.length > 0 ? last(bMatches)[k] : v;
|
||||
break;
|
||||
default:
|
||||
var currentRule_1 = operations[k];
|
||||
// Use .flat(); starting from Node 12
|
||||
var b_1 = bMatches
|
||||
.map(function (o) { return o[k]; })
|
||||
.reduce(function (acc, val) {
|
||||
return isArray(acc) && isArray(val) ? __spread(acc, val) : acc;
|
||||
}, []);
|
||||
ret[k] = mergeWithRule({ currentRule: currentRule_1, a: v, b: b_1 });
|
||||
break;
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
});
|
||||
return ret.concat(b.filter(function (o) { return !bAllMatches.includes(o); }));
|
||||
}
|
||||
function mergeIndividualRule(_a) {
|
||||
var currentRule = _a.currentRule, a = _a.a, b = _a.b;
|
||||
// What if there's no match?
|
||||
switch (currentRule) {
|
||||
case types_1.CustomizeRule.Append:
|
||||
return a.concat(b);
|
||||
case types_1.CustomizeRule.Prepend:
|
||||
return b.concat(a);
|
||||
case types_1.CustomizeRule.Replace:
|
||||
return b;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
function last(arr) {
|
||||
return arr[arr.length - 1];
|
||||
}
|
||||
function customizeObject(rules) {
|
||||
return function (a, b, key) {
|
||||
switch (rules[key]) {
|
||||
case types_1.CustomizeRule.Prepend:
|
||||
return merge_with_1["default"]([b, a], join_arrays_1["default"]());
|
||||
case types_1.CustomizeRule.Replace:
|
||||
return b;
|
||||
case types_1.CustomizeRule.Append:
|
||||
return merge_with_1["default"]([a, b], join_arrays_1["default"]());
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.customizeObject = customizeObject;
|
||||
//# sourceMappingURL=index.js.map
|
1
assets_old/node_modules/webpack-merge/dist/index.js.map
generated
vendored
Normal file
1
assets_old/node_modules/webpack-merge/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
assets_old/node_modules/webpack-merge/dist/join-arrays.d.ts
generated
vendored
Normal file
6
assets_old/node_modules/webpack-merge/dist/join-arrays.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { Customize, Key } from "./types";
|
||||
export default function joinArrays({ customizeArray, customizeObject, key, }?: {
|
||||
customizeArray?: Customize;
|
||||
customizeObject?: Customize;
|
||||
key?: Key;
|
||||
}): (a: any, b: any, k: Key) => any;
|
69
assets_old/node_modules/webpack-merge/dist/join-arrays.js
generated
vendored
Normal file
69
assets_old/node_modules/webpack-merge/dist/join-arrays.js
generated
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spread = (this && this.__spread) || function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
exports.__esModule = true;
|
||||
var clone_deep_1 = __importDefault(require("clone-deep"));
|
||||
var merge_with_1 = __importDefault(require("./merge-with"));
|
||||
var utils_1 = require("./utils");
|
||||
var isArray = Array.isArray;
|
||||
function joinArrays(_a) {
|
||||
var _b = _a === void 0 ? {} : _a, customizeArray = _b.customizeArray, customizeObject = _b.customizeObject, key = _b.key;
|
||||
return function _joinArrays(a, b, k) {
|
||||
var newKey = key ? key + "." + k : k;
|
||||
if (utils_1.isFunction(a) && utils_1.isFunction(b)) {
|
||||
return function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return _joinArrays(a.apply(void 0, __spread(args)), b.apply(void 0, __spread(args)), k);
|
||||
};
|
||||
}
|
||||
if (isArray(a) && isArray(b)) {
|
||||
var customResult = customizeArray && customizeArray(a, b, newKey);
|
||||
return customResult || __spread(a, b);
|
||||
}
|
||||
if (utils_1.isRegex(b)) {
|
||||
return b;
|
||||
}
|
||||
if (utils_1.isPlainObject(a) && utils_1.isPlainObject(b)) {
|
||||
var customResult = customizeObject && customizeObject(a, b, newKey);
|
||||
return (customResult ||
|
||||
merge_with_1["default"]([a, b], joinArrays({
|
||||
customizeArray: customizeArray,
|
||||
customizeObject: customizeObject,
|
||||
key: newKey
|
||||
})));
|
||||
}
|
||||
if (utils_1.isPlainObject(b)) {
|
||||
return clone_deep_1["default"](b);
|
||||
}
|
||||
if (isArray(b)) {
|
||||
return __spread(b);
|
||||
}
|
||||
return b;
|
||||
};
|
||||
}
|
||||
exports["default"] = joinArrays;
|
||||
//# sourceMappingURL=join-arrays.js.map
|
1
assets_old/node_modules/webpack-merge/dist/join-arrays.js.map
generated
vendored
Normal file
1
assets_old/node_modules/webpack-merge/dist/join-arrays.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"join-arrays.js","sourceRoot":"","sources":["../src/join-arrays.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAAmC;AAEnC,4DAAqC;AACrC,iCAA6D;AAE7D,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;AAE9B,SAAwB,UAAU,CAAC,EAQ7B;QAR6B,qBAQ/B,EAAE,KAAA,EAPJ,cAAc,oBAAA,EACd,eAAe,qBAAA,EACf,GAAG,SAAA;IAMH,OAAO,SAAS,WAAW,CAAC,CAAM,EAAE,CAAM,EAAE,CAAM;QAChD,IAAM,MAAM,GAAG,GAAG,CAAC,CAAC,CAAI,GAAG,SAAI,CAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvC,IAAI,kBAAU,CAAC,CAAC,CAAC,IAAI,kBAAU,CAAC,CAAC,CAAC,EAAE;YAClC,OAAO;gBAAC,cAAc;qBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;oBAAd,yBAAc;;gBAAK,OAAA,WAAW,CAAC,CAAC,wBAAI,IAAI,IAAG,CAAC,wBAAI,IAAI,IAAG,CAAC,CAAC;YAAtC,CAAsC,CAAC;SACnE;QAED,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;YAC5B,IAAM,YAAY,GAAG,cAAc,IAAI,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;YAEpE,OAAO,YAAY,aAAQ,CAAC,EAAK,CAAC,CAAC,CAAC;SACrC;QAED,IAAI,eAAO,CAAC,CAAC,CAAC,EAAE;YACd,OAAO,CAAC,CAAC;SACV;QAED,IAAI,qBAAa,CAAC,CAAC,CAAC,IAAI,qBAAa,CAAC,CAAC,CAAC,EAAE;YACxC,IAAM,YAAY,GAAG,eAAe,IAAI,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;YAEtE,OAAO,CACL,YAAY;gBACZ,uBAAS,CACP,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,UAAU,CAAC;oBACT,cAAc,gBAAA;oBACd,eAAe,iBAAA;oBACf,GAAG,EAAE,MAAM;iBACZ,CAAC,CACH,CACF,CAAC;SACH;QAED,IAAI,qBAAa,CAAC,CAAC,CAAC,EAAE;YACpB,OAAO,uBAAS,CAAC,CAAC,CAAC,CAAC;SACrB;QAED,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;YACd,gBAAW,CAAC,EAAE;SACf;QAED,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC;AApDD,gCAoDC"}
|
2
assets_old/node_modules/webpack-merge/dist/merge-with.d.ts
generated
vendored
Normal file
2
assets_old/node_modules/webpack-merge/dist/merge-with.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
declare function mergeWith(objects: object[], customizer: any): object;
|
||||
export default mergeWith;
|
38
assets_old/node_modules/webpack-merge/dist/merge-with.js
generated
vendored
Normal file
38
assets_old/node_modules/webpack-merge/dist/merge-with.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
exports.__esModule = true;
|
||||
function mergeWith(objects, customizer) {
|
||||
var _a = __read(objects), first = _a[0], rest = _a.slice(1);
|
||||
var ret = first;
|
||||
rest.forEach(function (a) {
|
||||
ret = mergeTo(ret, a, customizer);
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
function mergeTo(a, b, customizer) {
|
||||
var ret = {};
|
||||
Object.keys(a)
|
||||
.concat(Object.keys(b))
|
||||
.forEach(function (k) {
|
||||
var v = customizer(a[k], b[k], k);
|
||||
ret[k] = typeof v === "undefined" ? a[k] : v;
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
exports["default"] = mergeWith;
|
||||
//# sourceMappingURL=merge-with.js.map
|
1
assets_old/node_modules/webpack-merge/dist/merge-with.js.map
generated
vendored
Normal file
1
assets_old/node_modules/webpack-merge/dist/merge-with.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"merge-with.js","sourceRoot":"","sources":["../src/merge-with.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,CAAC,OAAiB,EAAE,UAAU;IACxC,IAAA,KAAA,OAAmB,OAAO,CAAA,EAAzB,KAAK,QAAA,EAAK,IAAI,cAAW,CAAC;IACjC,IAAI,GAAG,GAAG,KAAK,CAAC;IAEhB,IAAI,CAAC,OAAO,CAAC,UAAC,CAAC;QACb,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU;IAC/B,IAAM,GAAG,GAAG,EAAE,CAAC;IAEf,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SACX,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACtB,OAAO,CAAC,UAAC,CAAC;QACT,IAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEpC,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEL,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qBAAe,SAAS,CAAC"}
|
13
assets_old/node_modules/webpack-merge/dist/types.d.ts
generated
vendored
Normal file
13
assets_old/node_modules/webpack-merge/dist/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
export declare type Key = string;
|
||||
export declare type Customize = (a: any, b: any, key: Key) => any;
|
||||
export interface ICustomizeOptions {
|
||||
customizeArray?: Customize;
|
||||
customizeObject?: Customize;
|
||||
}
|
||||
export declare enum CustomizeRule {
|
||||
Match = "match",
|
||||
Merge = "merge",
|
||||
Append = "append",
|
||||
Prepend = "prepend",
|
||||
Replace = "replace"
|
||||
}
|
12
assets_old/node_modules/webpack-merge/dist/types.js
generated
vendored
Normal file
12
assets_old/node_modules/webpack-merge/dist/types.js
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.CustomizeRule = void 0;
|
||||
var CustomizeRule;
|
||||
(function (CustomizeRule) {
|
||||
CustomizeRule["Match"] = "match";
|
||||
CustomizeRule["Merge"] = "merge";
|
||||
CustomizeRule["Append"] = "append";
|
||||
CustomizeRule["Prepend"] = "prepend";
|
||||
CustomizeRule["Replace"] = "replace";
|
||||
})(CustomizeRule = exports.CustomizeRule || (exports.CustomizeRule = {}));
|
||||
//# sourceMappingURL=types.js.map
|
1
assets_old/node_modules/webpack-merge/dist/types.js.map
generated
vendored
Normal file
1
assets_old/node_modules/webpack-merge/dist/types.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AASA,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EANW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAMxB"}
|
2
assets_old/node_modules/webpack-merge/dist/unique.d.ts
generated
vendored
Normal file
2
assets_old/node_modules/webpack-merge/dist/unique.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
declare function mergeUnique(key: string, uniques: string[], getter: (a: object) => string): (a: [], b: [], k: string) => false | any[];
|
||||
export default mergeUnique;
|
40
assets_old/node_modules/webpack-merge/dist/unique.js
generated
vendored
Normal file
40
assets_old/node_modules/webpack-merge/dist/unique.js
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spread = (this && this.__spread) || function () {
|
||||
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
||||
return ar;
|
||||
};
|
||||
exports.__esModule = true;
|
||||
function mergeUnique(key, uniques, getter) {
|
||||
var uniquesSet = new Set(uniques);
|
||||
return function (a, b, k) {
|
||||
return (k === key) && Array.from(__spread(a, b).map(function (it) { return ({ key: getter(it), value: it }); })
|
||||
.map(function (_a) {
|
||||
var key = _a.key, value = _a.value;
|
||||
return ({ key: (uniquesSet.has(key) ? key : value), value: value });
|
||||
})
|
||||
.reduce(function (m, _a) {
|
||||
var key = _a.key, value = _a.value;
|
||||
m["delete"](key); // This is required to preserve backward compatible order of elements after a merge.
|
||||
return m.set(key, value);
|
||||
}, new Map())
|
||||
.values());
|
||||
};
|
||||
}
|
||||
exports["default"] = mergeUnique;
|
||||
//# sourceMappingURL=unique.js.map
|
1
assets_old/node_modules/webpack-merge/dist/unique.js.map
generated
vendored
Normal file
1
assets_old/node_modules/webpack-merge/dist/unique.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"unique.js","sourceRoot":"","sources":["../src/unique.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,CAClB,GAAW,EACX,OAAiB,EACjB,MAA6B;IAE7B,IAAI,UAAU,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,UAAC,CAAK,EAAE,CAAK,EAAE,CAAS;QAC7B,OAAA,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CACvB,SAAI,CAAC,EAAK,CAAC,EACN,GAAG,CAAC,UAAC,EAAU,IAAK,OAAA,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAhC,CAAgC,CAAC;aACrD,GAAG,CAAC,UAAC,EAAc;gBAAZ,GAAG,SAAA,EAAE,KAAK,WAAA;YAAO,OAAA,CAAC,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC;QAA3D,CAA2D,CAAC;aACpF,MAAM,CACH,UAAC,CAAC,EAAE,EAAa;gBAAX,GAAG,SAAA,EAAE,KAAK,WAAA;YACd,CAAC,CAAC,QAAM,CAAA,CAAC,GAAG,CAAC,CAAC,CAAC,oFAAoF;YACnG,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAC1B,CAAC,EACD,IAAI,GAAG,EAAY,CAAC;aACvB,MAAM,EAAE,CAAC;IAVhB,CAUgB,CAAA;AACpB,CAAC;AAED,qBAAe,WAAW,CAAC"}
|
5
assets_old/node_modules/webpack-merge/dist/utils.d.ts
generated
vendored
Normal file
5
assets_old/node_modules/webpack-merge/dist/utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
declare function isRegex(o: any): boolean;
|
||||
declare function isFunction(functionToCheck: any): boolean;
|
||||
declare function isPlainObject(a: any): boolean;
|
||||
declare function isUndefined(a: any): boolean;
|
||||
export { isRegex, isFunction, isPlainObject, isUndefined };
|
24
assets_old/node_modules/webpack-merge/dist/utils.js
generated
vendored
Normal file
24
assets_old/node_modules/webpack-merge/dist/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.isUndefined = exports.isPlainObject = exports.isFunction = exports.isRegex = void 0;
|
||||
function isRegex(o) {
|
||||
return o instanceof RegExp;
|
||||
}
|
||||
exports.isRegex = isRegex;
|
||||
// https://stackoverflow.com/a/7356528/228885
|
||||
function isFunction(functionToCheck) {
|
||||
return (functionToCheck && {}.toString.call(functionToCheck) === "[object Function]");
|
||||
}
|
||||
exports.isFunction = isFunction;
|
||||
function isPlainObject(a) {
|
||||
if (a === null || Array.isArray(a)) {
|
||||
return false;
|
||||
}
|
||||
return typeof a === "object";
|
||||
}
|
||||
exports.isPlainObject = isPlainObject;
|
||||
function isUndefined(a) {
|
||||
return typeof a === "undefined";
|
||||
}
|
||||
exports.isUndefined = isUndefined;
|
||||
//# sourceMappingURL=utils.js.map
|
1
assets_old/node_modules/webpack-merge/dist/utils.js.map
generated
vendored
Normal file
1
assets_old/node_modules/webpack-merge/dist/utils.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,SAAS,OAAO,CAAC,CAAC;IAChB,OAAO,CAAC,YAAY,MAAM,CAAC;AAC7B,CAAC;AAqBQ,0BAAO;AAnBhB,6CAA6C;AAC7C,SAAS,UAAU,CAAC,eAAe;IACjC,OAAO,CACL,eAAe,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,mBAAmB,CAC7E,CAAC;AACJ,CAAC;AAciB,gCAAU;AAZ5B,SAAS,aAAa,CAAC,CAAC;IACtB,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAClC,OAAO,KAAK,CAAC;KACd;IAED,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;AAC/B,CAAC;AAM6B,sCAAa;AAJ3C,SAAS,WAAW,CAAC,CAAC;IACpB,OAAO,OAAO,CAAC,KAAK,WAAW,CAAC;AAClC,CAAC;AAE4C,kCAAW"}
|
58
assets_old/node_modules/webpack-merge/package.json
generated
vendored
Normal file
58
assets_old/node_modules/webpack-merge/package.json
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"name": "webpack-merge",
|
||||
"description": "Variant of merge that's useful for webpack configuration",
|
||||
"author": "Juho Vepsalainen <bebraw@gmail.com>",
|
||||
"version": "5.7.3",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"format": "prettier . --write --ignore-path .gitignore",
|
||||
"start": "tsdx watch",
|
||||
"test": "tsdx test",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"clone-deep": "^4.0.1",
|
||||
"wildcard": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/estree": "0.0.45",
|
||||
"husky": "^4.3.0",
|
||||
"prettier": "^2.1.2",
|
||||
"tsdx": "^0.14.1",
|
||||
"tslib": "^2.0.3",
|
||||
"typescript": "^4.0.5",
|
||||
"webpack": "^5.3.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/survivejs/webpack-merge.git"
|
||||
},
|
||||
"homepage": "https://github.com/survivejs/webpack-merge",
|
||||
"bugs": {
|
||||
"url": "https://github.com/survivejs/webpack-merge/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"webpack",
|
||||
"merge"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"jest": {
|
||||
"collectCoverage": true,
|
||||
"collectCoverageFrom": [
|
||||
"dist/*.js"
|
||||
]
|
||||
},
|
||||
"license": "MIT",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run test"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue