first commit

This commit is contained in:
DanielRamirezGe
2020-01-14 20:43:08 -06:00
parent 3557894f7f
commit 5eecfbf6cd
26326 changed files with 2434803 additions and 0 deletions
+331
View File
@@ -0,0 +1,331 @@
### Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
### [v6.0.0](https://github.com/neutrinojs/webpack-chain/compare/v5.2.4...v6.0.0)
> 3 May 2019
- Lock file maintenance [`#169`](https://github.com/neutrinojs/webpack-chain/pull/169)
- Update linting configuration, support Node.js 12 in CI [`#168`](https://github.com/neutrinojs/webpack-chain/pull/168)
- Extended DevServer method [`#167`](https://github.com/neutrinojs/webpack-chain/pull/167)
- Lock file maintenance [`#165`](https://github.com/neutrinojs/webpack-chain/pull/165)
- Update dependency eslint-plugin-ava to v6 [`#161`](https://github.com/neutrinojs/webpack-chain/pull/161)
- Point docs to v6 [`37201a2`](https://github.com/neutrinojs/webpack-chain/commit/37201a2974c078c3494243ff03342ba16910db21)
#### [v5.2.4](https://github.com/neutrinojs/webpack-chain/compare/v5.2.3...v5.2.4)
> 25 March 2019
- fix Use#end return type in OneOf [`#158`](https://github.com/neutrinojs/webpack-chain/pull/158)
- make __expression property works in any object [`#157`](https://github.com/neutrinojs/webpack-chain/pull/157)
- Lock file maintenance [`#160`](https://github.com/neutrinojs/webpack-chain/pull/160)
- docs: Fix typo in config.optimization example [`#159`](https://github.com/neutrinojs/webpack-chain/pull/159)
#### [v5.2.3](https://github.com/neutrinojs/webpack-chain/compare/v5.2.2...v5.2.3)
> 22 March 2019
- optimize type definitions [`#156`](https://github.com/neutrinojs/webpack-chain/pull/156)
- Lock file maintenance [`#155`](https://github.com/neutrinojs/webpack-chain/pull/155)
#### [v5.2.2](https://github.com/neutrinojs/webpack-chain/compare/v5.2.1...v5.2.2)
> 12 March 2019
- Fix README comment rendering [`#154`](https://github.com/neutrinojs/webpack-chain/pull/154)
- Lock file maintenance [`#153`](https://github.com/neutrinojs/webpack-chain/pull/153)
- Update dependency javascript-stringify to v2 [`#151`](https://github.com/neutrinojs/webpack-chain/pull/151)
- Fix stringify master bustage [`55f6a5d`](https://github.com/neutrinojs/webpack-chain/commit/55f6a5d25b58d03fbc57a17d8c2e09de310fa068)
#### [v5.2.1](https://github.com/neutrinojs/webpack-chain/compare/v5.2.0...v5.2.1)
> 7 March 2019
- Lock file maintenance [`#145`](https://github.com/neutrinojs/webpack-chain/pull/145)
- Add `config.output.globalObject` type [`#147`](https://github.com/neutrinojs/webpack-chain/pull/147)
- add module-rule-type [`#148`](https://github.com/neutrinojs/webpack-chain/pull/148)
- Update `config.mode` type [`#146`](https://github.com/neutrinojs/webpack-chain/pull/146)
- Update dependency eslint-config-prettier to v4 [`75aa60b`](https://github.com/neutrinojs/webpack-chain/commit/75aa60b760947cd8eb438691158dd9db52f4f9f5)
#### [v5.2.0](https://github.com/neutrinojs/webpack-chain/compare/v5.1.0...v5.2.0)
> 23 January 2019
- Add `config.name` type [`#143`](https://github.com/neutrinojs/webpack-chain/pull/143)
- Add TypeScript type definitions [`#132`](https://github.com/neutrinojs/webpack-chain/pull/132)
- docs: Fix typo of 'optimization' [`#139`](https://github.com/neutrinojs/webpack-chain/pull/139)
#### [v5.1.0](https://github.com/neutrinojs/webpack-chain/compare/v5.0.1...v5.1.0)
> 16 January 2019
- Support config.name() setter [`#131`](https://github.com/neutrinojs/webpack-chain/pull/131)
- Allow use of before() and after() with oneOf rules [`#133`](https://github.com/neutrinojs/webpack-chain/pull/133)
- Travis: Test against Node 11 [`#118`](https://github.com/neutrinojs/webpack-chain/pull/118)
- docs: Fix typo in devServer options [`#117`](https://github.com/neutrinojs/webpack-chain/pull/117)
- Update dependency ava to v1 [`ce9e884`](https://github.com/neutrinojs/webpack-chain/commit/ce9e884f988a01ac6297d167dfd013cab8d8c24a)
- Lock file maintenance [`d124b5d`](https://github.com/neutrinojs/webpack-chain/commit/d124b5df6648257092becae81ceece9bef5485b8)
#### [v5.0.1](https://github.com/neutrinojs/webpack-chain/compare/v5.0.0...v5.0.1)
> 22 October 2018
- Fix toString() output for alternative types of plugin [`#116`](https://github.com/neutrinojs/webpack-chain/pull/116)
### [v5.0.0](https://github.com/neutrinojs/webpack-chain/compare/v4.12.1...v5.0.0)
> 8 October 2018
- README: Add NPM/Travis badges [`#112`](https://github.com/neutrinojs/webpack-chain/pull/112)
- Provide the same API for config.optimization.minimizer as config.plugins [`#84`](https://github.com/neutrinojs/webpack-chain/pull/84)
#### [v4.12.1](https://github.com/neutrinojs/webpack-chain/compare/v4.12.0...v4.12.1)
> 3 October 2018
- Switch from changelog to auto-changelog [`#109`](https://github.com/neutrinojs/webpack-chain/pull/109)
- Allow passing entry as a string to config.merge() [`#107`](https://github.com/neutrinojs/webpack-chain/pull/107)
- Lock file maintenance [`#101`](https://github.com/neutrinojs/webpack-chain/pull/101)
- Update dependency eslint-plugin-prettier to v3 [`e42d8bd`](https://github.com/neutrinojs/webpack-chain/commit/e42d8bd2f6f70841c4d1ab7a2926c26d3ec828ed)
#### [v4.12.0](https://github.com/neutrinojs/webpack-chain/compare/v4.11.0...v4.12.0)
> 28 September 2018
- Revert changes to gitignore [`c1250a0`](https://github.com/neutrinojs/webpack-chain/commit/c1250a0fe7ffafa82f529ac8e7262e2c3cdd4729)
#### [v4.11.0](https://github.com/neutrinojs/webpack-chain/compare/v4.10.0...v4.11.0)
> 13 September 2018
- Support specifying plugins by path [`#102`](https://github.com/neutrinojs/webpack-chain/pull/102)
- Lock file maintenance [`#100`](https://github.com/neutrinojs/webpack-chain/pull/100)
- Lock file maintenance [`#96`](https://github.com/neutrinojs/webpack-chain/pull/96)
#### [v4.10.0](https://github.com/neutrinojs/webpack-chain/compare/v4.9.0...v4.10.0)
> 6 September 2018
- Use the Resolve API to define ResolveLoader according to webpack [`#99`](https://github.com/neutrinojs/webpack-chain/pull/99)
- Migrate to new org [`#92`](https://github.com/neutrinojs/webpack-chain/pull/92)
- test: 'clean' in 'ChainedMap' [`#93`](https://github.com/neutrinojs/webpack-chain/pull/93)
- Lock file maintenance [`3a4b3e1`](https://github.com/neutrinojs/webpack-chain/commit/3a4b3e10032856ab7f01afa67a23dd9e4e68161a)
- Lock file maintenance [`815bfd1`](https://github.com/neutrinojs/webpack-chain/commit/815bfd173a2dc6f802b66a48cdb2c4d2ff47df9f)
#### [v4.9.0](https://github.com/neutrinojs/webpack-chain/compare/v4.8.0...v4.9.0)
> 15 August 2018
- Update to ESLint 5 [`#89`](https://github.com/neutrinojs/webpack-chain/pull/89)
- Lock file maintenance [`#85`](https://github.com/neutrinojs/webpack-chain/pull/85)
- Implement ChainedMap.getOrCompute [`#63`](https://github.com/neutrinojs/webpack-chain/pull/63)
- Support Object literal plugin usage [`#86`](https://github.com/neutrinojs/webpack-chain/pull/86)
- Lock file maintenance [`#61`](https://github.com/neutrinojs/webpack-chain/pull/61)
- Lock file maintenance [`#60`](https://github.com/neutrinojs/webpack-chain/pull/60)
- Update dependency eslint-config-airbnb-base to v13 [`7370962`](https://github.com/neutrinojs/webpack-chain/commit/73709628a6ff6661e478c652d0ff03b99b6c2abb)
- merge resolve plugins just like config [`c47ee2d`](https://github.com/neutrinojs/webpack-chain/commit/c47ee2d52c1be4fcdbe10adef865e45d6fd729ef)
- Fix linting :/ [`30cc11d`](https://github.com/neutrinojs/webpack-chain/commit/30cc11d0d35a5676069a623b180c8e7b00e099e4)
- Fix README bug, test in Node.js v6 [`4a37c74`](https://github.com/neutrinojs/webpack-chain/commit/4a37c74e1f790e118034154da9c32d0e36164f74)
- linted [`dff82f8`](https://github.com/neutrinojs/webpack-chain/commit/dff82f8494394dcf8c97bff324f877513f44fa56)
- Run yarn lint --fix [`9384537`](https://github.com/neutrinojs/webpack-chain/commit/9384537269d60bb80b3330cf44ddbdd9d528c454)
#### [v4.8.0](https://github.com/neutrinojs/webpack-chain/compare/v4.7.0...v4.8.0)
> 16 May 2018
- Expose toString as a static method on Config [`#57`](https://github.com/neutrinojs/webpack-chain/pull/57)
- Add test for Config.toString, add README note [`0107aef`](https://github.com/neutrinojs/webpack-chain/commit/0107aef203202aef069190723b04ec4f6ac80b9f)
#### [v4.7.0](https://github.com/neutrinojs/webpack-chain/compare/v4.6.0...v4.7.0)
> 15 May 2018
- Lint with eslint, prettier, airbnb [`#52`](https://github.com/neutrinojs/webpack-chain/pull/52)
- Support Config.toString() with name hints [`#53`](https://github.com/neutrinojs/webpack-chain/pull/53)
- Configure Renovate [`#54`](https://github.com/neutrinojs/webpack-chain/pull/54)
- Lock file maintenance [`50d4db8`](https://github.com/neutrinojs/webpack-chain/commit/50d4db81ab5fe62a55435720f5c78ddc40309a88)
#### [v4.6.0](https://github.com/neutrinojs/webpack-chain/compare/v4.5.0...v4.6.0)
> 16 April 2018
- Support Webpack 4.x [`#51`](https://github.com/neutrinojs/webpack-chain/pull/51)
- Update devDependencies [`#50`](https://github.com/neutrinojs/webpack-chain/pull/50)
#### [v4.5.0](https://github.com/neutrinojs/webpack-chain/compare/v4.4.2...v4.5.0)
> 22 November 2017
- Introduce method for performing a batch of operations against a context [`#43`](https://github.com/neutrinojs/webpack-chain/pull/43)
#### [v4.4.2](https://github.com/neutrinojs/webpack-chain/compare/v4.4.1...v4.4.2)
> 10 October 2017
- Update changelog [`1bb3da1`](https://github.com/neutrinojs/webpack-chain/commit/1bb3da1fec04a158f68762e57aff33a0172a298f)
- Hotfix - guard against non-defined entries when ordering chainedmap [`76be81f`](https://github.com/neutrinojs/webpack-chain/commit/76be81f4509b9652bef25cc55747df87850b858e)
- Updating changelog [`a71fc4b`](https://github.com/neutrinojs/webpack-chain/commit/a71fc4b70ccce358aacc29ed7dc5d8cdacdd4cc1)
#### [v4.4.1](https://github.com/neutrinojs/webpack-chain/compare/v4.4.0...v4.4.1)
> 6 October 2017
- Updating changelog [`97a2fab`](https://github.com/neutrinojs/webpack-chain/commit/97a2fabf6e51f1b03cacb0991ba02e236be983fa)
- Missing schema before/after [`8d8f26d`](https://github.com/neutrinojs/webpack-chain/commit/8d8f26dd0e6db375dbabb8e8dfe784e6c50408d5)
#### [v4.4.0](https://github.com/neutrinojs/webpack-chain/compare/v4.3.0...v4.4.0)
> 6 October 2017
- Feature: allow specifying to use before or after other use [`#42`](https://github.com/neutrinojs/webpack-chain/pull/42)
- Docs: Upstream fixes made to Neutrino's webpack-chain docs [`#41`](https://github.com/neutrinojs/webpack-chain/pull/41)
- Improve documentation for plugin configuration [`#40`](https://github.com/neutrinojs/webpack-chain/pull/40)
- Allow omitting keys from source merge object [`fb6ea2f`](https://github.com/neutrinojs/webpack-chain/commit/fb6ea2fad931c13e7516a3e9354215a78cb5c4ff)
- Feature: allow specifying .before or .after to order plugins and uses [`b0040bf`](https://github.com/neutrinojs/webpack-chain/commit/b0040bff73b3b9e55d53192ac4a447a2ac8c02d1)
- Rename when arguments to be clearer [`d15e895`](https://github.com/neutrinojs/webpack-chain/commit/d15e895669ce0a44c704755af39290700e73e85f)
- Bumping deps [`c15be4a`](https://github.com/neutrinojs/webpack-chain/commit/c15be4ab99d232126bbf18666f4f20f80df21f90)
- Update changelog [`5aec63a`](https://github.com/neutrinojs/webpack-chain/commit/5aec63a424c71a9a603540b33e576999c839f074)
#### [v4.3.0](https://github.com/neutrinojs/webpack-chain/compare/v4.2.0...v4.3.0)
> 13 September 2017
- Update API for base config, dev server, and output [`#38`](https://github.com/neutrinojs/webpack-chain/pull/38)
- Update changelog [`6260f49`](https://github.com/neutrinojs/webpack-chain/commit/6260f49edbcab301988b7b2c6c8a77e07707c010)
#### [v4.2.0](https://github.com/neutrinojs/webpack-chain/compare/v4.1.0...v4.2.0)
> 13 September 2017
- Add new shorthands from resolve and output [`#37`](https://github.com/neutrinojs/webpack-chain/pull/37)
- changelog [`0374e51`](https://github.com/neutrinojs/webpack-chain/commit/0374e518a4b465c73b5097eff6e4c77768319e4f)
- Updating README with shorthands [`ae5e75a`](https://github.com/neutrinojs/webpack-chain/commit/ae5e75ae619d0399bcbf8e588a48759b0e590b6e)
#### [v4.1.0](https://github.com/neutrinojs/webpack-chain/compare/v4.0.0...v4.1.0)
> 12 September 2017
- Updating rule definition shortcuts, adding oneOf [`#36`](https://github.com/neutrinojs/webpack-chain/pull/36)
### [v4.0.0](https://github.com/neutrinojs/webpack-chain/compare/v3.3.0...v4.0.0)
> 3 August 2017
- Switch noParse to getter/setter to allow webpack v3 function argument [`#32`](https://github.com/neutrinojs/webpack-chain/pull/32)
- Serialize performance into config output [`#31`](https://github.com/neutrinojs/webpack-chain/pull/31)
- Release v4.0.0 [`e84b002`](https://github.com/neutrinojs/webpack-chain/commit/e84b00207f6d4f4dc37c43ffffc65d8a34f63a75)
#### [v3.3.0](https://github.com/neutrinojs/webpack-chain/compare/v3.2.0...v3.3.0)
> 18 May 2017
- Adding noParse on module [`#27`](https://github.com/neutrinojs/webpack-chain/pull/27)
- Releasing v3.3.0 [`4a59bef`](https://github.com/neutrinojs/webpack-chain/commit/4a59bef687f273503945e638fefe1f6ab29857d1)
#### [v3.2.0](https://github.com/neutrinojs/webpack-chain/compare/v3.1.0...v3.2.0)
> 12 April 2017
- Adding updated shorthand methods for devServer [`#23`](https://github.com/neutrinojs/webpack-chain/pull/23)
#### [v3.1.0](https://github.com/neutrinojs/webpack-chain/compare/v3.0.0...v3.1.0)
> 29 March 2017
- Allow conditional configuration via when [`#22`](https://github.com/neutrinojs/webpack-chain/pull/22)
- Update README with links to previous docs versions [`0dc3984`](https://github.com/neutrinojs/webpack-chain/commit/0dc39841b76c5e4d9493fa86d7f65e66145a6964)
- Update README with links to previous docs versions [`bcc2362`](https://github.com/neutrinojs/webpack-chain/commit/bcc2362d396cee736feaa5e4537150b4a1fa2d4a)
### [v3.0.0](https://github.com/neutrinojs/webpack-chain/compare/v2.0.1...v3.0.0)
> 8 March 2017
- Make rule.include, rule.exclude, loaders and plugins more extensible [`#16`](https://github.com/neutrinojs/webpack-chain/pull/16)
#### [v2.0.1](https://github.com/neutrinojs/webpack-chain/compare/v2.0.0...v2.0.1)
> 8 March 2017
- undefined plugin [`#17`](https://github.com/neutrinojs/webpack-chain/pull/17)
### [v2.0.0](https://github.com/neutrinojs/webpack-chain/compare/v1.4.3...v2.0.0)
> 6 March 2017
- Adding testing, which informed v2 API, updated docs to reflect [`#14`](https://github.com/neutrinojs/webpack-chain/pull/14)
- Make Plugin API consistent with Loader API [`#13`](https://github.com/neutrinojs/webpack-chain/pull/13)
- MPL license, moving to mozilla-neutrino [`f122edd`](https://github.com/neutrinojs/webpack-chain/commit/f122eddccb9f7af9742f5c447c651172700b4c50)
#### [v1.4.3](https://github.com/neutrinojs/webpack-chain/compare/v1.4.2...v1.4.3)
> 4 March 2017
- Adding ChainedMap and ChainedSet documentation [`b071f82`](https://github.com/neutrinojs/webpack-chain/commit/b071f82042c7806f6d2df412a0154c1b985c4763)
- Removing empty entities from cluttering configuration object [`b428e55`](https://github.com/neutrinojs/webpack-chain/commit/b428e55a671a033c133ba2e225796845307dee12)
- Docs: getConfig -> toConfig [`2468eaa`](https://github.com/neutrinojs/webpack-chain/commit/2468eaac7e4c2f74cae244a4af6d2a517483db7b)
#### [v1.4.2](https://github.com/neutrinojs/webpack-chain/compare/v1.4.1...v1.4.2)
> 2 March 2017
- Fix bug where `exclude` doesn't return `this` [`#7`](https://github.com/neutrinojs/webpack-chain/pull/7)
- Bumping to v1.4.2 [`38d1412`](https://github.com/neutrinojs/webpack-chain/commit/38d1412037780b815c537de2abd5f02443b80502)
#### [v1.4.1](https://github.com/neutrinojs/webpack-chain/compare/v1.4.0...v1.4.1)
> 26 February 2017
- Allowing config merge to append to existing rule loaders [`#3`](https://github.com/neutrinojs/webpack-chain/pull/3)
- docs(readme): fix typo in devtool option [`#1`](https://github.com/neutrinojs/webpack-chain/pull/1)
#### [v1.4.0](https://github.com/neutrinojs/webpack-chain/compare/v1.3.0...v1.4.0)
> 15 February 2017
- Adds rule test merge via string to regex, fixes externals not chainable [`a15b49e`](https://github.com/neutrinojs/webpack-chain/commit/a15b49ec28903708c04665d0c6cac3a956558a99)
#### [v1.3.0](https://github.com/neutrinojs/webpack-chain/compare/v1.2.0...v1.3.0)
> 14 February 2017
- Adding functionality for merging and object into a Config instance [`5f0b0c6`](https://github.com/neutrinojs/webpack-chain/commit/5f0b0c670e6ad946e0232a208abb667f749aeba4)
#### [v1.2.0](https://github.com/neutrinojs/webpack-chain/compare/v1.1.0...v1.2.0)
> 13 February 2017
- Adds hot flag for Config.DevServer [`c64a155`](https://github.com/neutrinojs/webpack-chain/commit/c64a1558188ab2a4982a7b3f2aba95ced50c9756)
#### [v1.1.0](https://github.com/neutrinojs/webpack-chain/compare/v1.0.3...v1.1.0)
> 13 February 2017
- Adding ChainedSet#prepend functionality [`cc86e7b`](https://github.com/neutrinojs/webpack-chain/commit/cc86e7bdbdcaca7610255039dcb31adfacb4952b)
#### [v1.0.3](https://github.com/neutrinojs/webpack-chain/compare/v1.0.2...v1.0.3)
> 10 February 2017
- Fixes exception with empty rule entries with loader only [`7964b34`](https://github.com/neutrinojs/webpack-chain/commit/7964b347ed613c7dc18e54f912467abad2956b8b)
#### [v1.0.2](https://github.com/neutrinojs/webpack-chain/compare/v1.0.1...v1.0.2)
> 9 February 2017
- Fixes plugin methods not chaining [`7cc56ed`](https://github.com/neutrinojs/webpack-chain/commit/7cc56ed5e331c7cc0ccd58f25feb3b1b0398829a)
#### [v1.0.1](https://github.com/neutrinojs/webpack-chain/compare/v1.0.0...v1.0.1)
> 9 February 2017
- Shared configuration documentation [`5c6a65b`](https://github.com/neutrinojs/webpack-chain/commit/5c6a65b344113ff3522d5f7d66dfacbc0ad7fa69)
- Avoid exceptions in empty config [`ab46ee0`](https://github.com/neutrinojs/webpack-chain/commit/ab46ee0234a04eb2b89190df32ea4287c499dd39)
#### v1.0.0
> 6 February 2017
- initial commit [`9e2a87c`](https://github.com/neutrinojs/webpack-chain/commit/9e2a87c5f6a1f1aac3eedbd4102e40dc47a8f7f4)
+373
View File
@@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
+1422
View File
File diff suppressed because it is too large Load Diff
+84
View File
@@ -0,0 +1,84 @@
{
"_from": "webpack-chain@^6.0.0",
"_id": "webpack-chain@6.0.0",
"_inBundle": false,
"_integrity": "sha512-NK62XgJOOSmYs4kaXFIKKeClpuOVHY7m6e4XwxbVX/2HAUboH6xFCTVXMVv8+jB6K8o/UGjlo1Cv3XXOyNAAGw==",
"_location": "/webpack-chain",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "webpack-chain@^6.0.0",
"name": "webpack-chain",
"escapedName": "webpack-chain",
"rawSpec": "^6.0.0",
"saveSpec": null,
"fetchSpec": "^6.0.0"
},
"_requiredBy": [
"/@vue/cli-service"
],
"_resolved": "https://registry.npmjs.org/webpack-chain/-/webpack-chain-6.0.0.tgz",
"_shasum": "9c36525a1271a54e7bfd1791199b395f400ae4f1",
"_spec": "webpack-chain@^6.0.0",
"_where": "/home/george/citwa/red_de_investigacion_front/first/node_modules/@vue/cli-service",
"author": {
"name": "Eli Perelman",
"email": "eli@eliperelman.com"
},
"bugs": {
"url": "https://github.com/neutrinojs/webpack-chain/issues"
},
"bundleDependencies": false,
"dependencies": {
"deepmerge": "^1.5.2",
"javascript-stringify": "^2.0.0"
},
"deprecated": false,
"description": "[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![Build Status][travis-image]][travis-url]",
"devDependencies": {
"@types/node": "^11.13.7",
"@types/webpack": "^4.4.21",
"auto-changelog": "^1.13.0",
"ava": "^1.0.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.6.1",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-ava": "^6.0.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-prettier": "^3.0.0",
"prettier": "^1.17.0",
"typescript": "^3.4.5",
"webpack": "^4.30.0"
},
"files": [
"src",
"types/*.d.ts"
],
"homepage": "https://github.com/neutrinojs/webpack-chain#readme",
"keywords": [
"webpack",
"config",
"chain",
"fluent",
"api"
],
"license": "MPL-2.0",
"main": "src/Config.js",
"name": "webpack-chain",
"repository": {
"type": "git",
"url": "git+https://github.com/neutrinojs/webpack-chain.git"
},
"scripts": {
"changelog": "auto-changelog --remote upstream --commit-limit false",
"lint": "eslint --cache --report-unused-disable-directives --format codeframe \".*.js\" src test",
"test": "ava test",
"test:types": "tsc -p ./types/test/tsconfig.json",
"version": "yarn changelog --package && git add CHANGELOG.md"
},
"typings": "types/index.d.ts",
"version": "6.0.0"
}
+14
View File
@@ -0,0 +1,14 @@
module.exports = class {
constructor(parent) {
this.parent = parent;
}
batch(handler) {
handler(this);
return this;
}
end() {
return this.parent;
}
};
+151
View File
@@ -0,0 +1,151 @@
const merge = require('deepmerge');
const Chainable = require('./Chainable');
module.exports = class extends Chainable {
constructor(parent) {
super(parent);
this.store = new Map();
}
extend(methods) {
this.shorthands = methods;
methods.forEach(method => {
this[method] = value => this.set(method, value);
});
return this;
}
clear() {
this.store.clear();
return this;
}
delete(key) {
this.store.delete(key);
return this;
}
order() {
const entries = [...this.store].reduce((acc, [key, value]) => {
acc[key] = value;
return acc;
}, {});
const names = Object.keys(entries);
const order = [...names];
names.forEach(name => {
if (!entries[name]) {
return;
}
const { __before, __after } = entries[name];
if (__before && order.includes(__before)) {
order.splice(order.indexOf(name), 1);
order.splice(order.indexOf(__before), 0, name);
} else if (__after && order.includes(__after)) {
order.splice(order.indexOf(name), 1);
order.splice(order.indexOf(__after) + 1, 0, name);
}
});
return { entries, order };
}
entries() {
const { entries, order } = this.order();
if (order.length) {
return entries;
}
return undefined;
}
values() {
const { entries, order } = this.order();
return order.map(name => entries[name]);
}
get(key) {
return this.store.get(key);
}
getOrCompute(key, fn) {
if (!this.has(key)) {
this.set(key, fn());
}
return this.get(key);
}
has(key) {
return this.store.has(key);
}
set(key, value) {
this.store.set(key, value);
return this;
}
merge(obj, omit = []) {
Object.keys(obj).forEach(key => {
if (omit.includes(key)) {
return;
}
const value = obj[key];
if (
(!Array.isArray(value) && typeof value !== 'object') ||
value === null ||
!this.has(key)
) {
this.set(key, value);
} else {
this.set(key, merge(this.get(key), value));
}
});
return this;
}
clean(obj) {
return Object.keys(obj).reduce((acc, key) => {
const value = obj[key];
if (value === undefined) {
return acc;
}
if (Array.isArray(value) && !value.length) {
return acc;
}
if (
Object.prototype.toString.call(value) === '[object Object]' &&
!Object.keys(value).length
) {
return acc;
}
acc[key] = value;
return acc;
}, {});
}
when(
condition,
whenTruthy = Function.prototype,
whenFalsy = Function.prototype,
) {
if (condition) {
whenTruthy(this);
} else {
whenFalsy(this);
}
return this;
}
};
+55
View File
@@ -0,0 +1,55 @@
const Chainable = require('./Chainable');
module.exports = class extends Chainable {
constructor(parent) {
super(parent);
this.store = new Set();
}
add(value) {
this.store.add(value);
return this;
}
prepend(value) {
this.store = new Set([value, ...this.store]);
return this;
}
clear() {
this.store.clear();
return this;
}
delete(value) {
this.store.delete(value);
return this;
}
values() {
return [...this.store];
}
has(value) {
return this.store.has(value);
}
merge(arr) {
this.store = new Set([...this.store, ...arr]);
return this;
}
when(
condition,
whenTruthy = Function.prototype,
whenFalsy = Function.prototype,
) {
if (condition) {
whenTruthy(this);
} else {
whenFalsy(this);
}
return this;
}
};
+178
View File
@@ -0,0 +1,178 @@
const ChainedMap = require('./ChainedMap');
const ChainedSet = require('./ChainedSet');
const Resolve = require('./Resolve');
const ResolveLoader = require('./ResolveLoader');
const Output = require('./Output');
const DevServer = require('./DevServer');
const Plugin = require('./Plugin');
const Module = require('./Module');
const Optimization = require('./Optimization');
const Performance = require('./Performance');
module.exports = class extends ChainedMap {
constructor() {
super();
this.devServer = new DevServer(this);
this.entryPoints = new ChainedMap(this);
this.module = new Module(this);
this.node = new ChainedMap(this);
this.optimization = new Optimization(this);
this.output = new Output(this);
this.performance = new Performance(this);
this.plugins = new ChainedMap(this);
this.resolve = new Resolve(this);
this.resolveLoader = new ResolveLoader(this);
this.extend([
'amd',
'bail',
'cache',
'context',
'devtool',
'externals',
'loader',
'mode',
'name',
'parallelism',
'profile',
'recordsInputPath',
'recordsPath',
'recordsOutputPath',
'stats',
'target',
'watch',
'watchOptions',
]);
}
static toString(config, { verbose = false, configPrefix = 'config' } = {}) {
// eslint-disable-next-line global-require
const { stringify } = require('javascript-stringify');
return stringify(
config,
(value, indent, stringify) => {
// improve plugin output
if (value && value.__pluginName) {
const prefix = `/* ${configPrefix}.${value.__pluginType}('${
value.__pluginName
}') */\n`;
const constructorExpression = value.__pluginPath
? // The path is stringified to ensure special characters are escaped
// (such as the backslashes in Windows-style paths).
`(require(${stringify(value.__pluginPath)}))`
: value.__pluginConstructorName;
if (constructorExpression) {
// get correct indentation for args by stringifying the args array and
// discarding the square brackets.
const args = stringify(value.__pluginArgs).slice(1, -1);
return `${prefix}new ${constructorExpression}(${args})`;
}
return (
prefix +
stringify(
value.__pluginArgs && value.__pluginArgs.length
? { args: value.__pluginArgs }
: {},
)
);
}
// improve rule/use output
if (value && value.__ruleNames) {
const prefix = `/* ${configPrefix}.module.rule('${
value.__ruleNames[0]
}')${value.__ruleNames
.slice(1)
.map(r => `.oneOf('${r}')`)
.join('')}${
value.__useName ? `.use('${value.__useName}')` : ``
} */\n`;
return prefix + stringify(value);
}
if (value && value.__expression) {
return value.__expression;
}
// shorten long functions
if (typeof value === 'function') {
if (!verbose && value.toString().length > 100) {
return `function () { /* omitted long function */ }`;
}
}
return stringify(value);
},
2,
);
}
entry(name) {
return this.entryPoints.getOrCompute(name, () => new ChainedSet(this));
}
plugin(name) {
return this.plugins.getOrCompute(name, () => new Plugin(this, name));
}
toConfig() {
const entryPoints = this.entryPoints.entries() || {};
return this.clean(
Object.assign(this.entries() || {}, {
node: this.node.entries(),
output: this.output.entries(),
resolve: this.resolve.toConfig(),
resolveLoader: this.resolveLoader.toConfig(),
devServer: this.devServer.toConfig(),
module: this.module.toConfig(),
optimization: this.optimization.toConfig(),
plugins: this.plugins.values().map(plugin => plugin.toConfig()),
performance: this.performance.entries(),
entry: Object.keys(entryPoints).reduce(
(acc, key) =>
Object.assign(acc, { [key]: entryPoints[key].values() }),
{},
),
}),
);
}
toString(options) {
return module.exports.toString(this.toConfig(), options);
}
merge(obj = {}, omit = []) {
const omissions = [
'node',
'output',
'resolve',
'resolveLoader',
'devServer',
'optimization',
'performance',
'module',
];
if (!omit.includes('entry') && 'entry' in obj) {
Object.keys(obj.entry).forEach(name =>
this.entry(name).merge([].concat(obj.entry[name])),
);
}
if (!omit.includes('plugin') && 'plugin' in obj) {
Object.keys(obj.plugin).forEach(name =>
this.plugin(name).merge(obj.plugin[name]),
);
}
omissions.forEach(key => {
if (!omit.includes(key) && key in obj) {
this[key].merge(obj[key]);
}
});
return super.merge(obj, [...omit, ...omissions, 'entry', 'plugin']);
}
};
+74
View File
@@ -0,0 +1,74 @@
const ChainedMap = require('./ChainedMap');
const ChainedSet = require('./ChainedSet');
module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.allowedHosts = new ChainedSet(this);
this.extend([
'after',
'before',
'bonjour',
'clientLogLevel',
'color',
'compress',
'contentBase',
'disableHostCheck',
'filename',
'headers',
'historyApiFallback',
'host',
'hot',
'hotOnly',
'http2',
'https',
'index',
'info',
'inline',
'lazy',
'mimeTypes',
'noInfo',
'open',
'openPage',
'overlay',
'pfx',
'pfxPassphrase',
'port',
'proxy',
'progress',
'public',
'publicPath',
'quiet',
'setup',
'socket',
'staticOptions',
'stats',
'stdin',
'useLocalIp',
'watchContentBase',
'watchOptions',
'writeToDisk',
]);
}
toConfig() {
return this.clean(
Object.assign(
{
allowedHosts: this.allowedHosts.values(),
},
this.entries() || {},
),
);
}
merge(obj, omit = []) {
if (!omit.includes('allowedHosts') && 'allowedHosts' in obj) {
this.allowedHosts.merge(obj.allowedHosts);
}
return super.merge(obj, ['allowedHosts']);
}
};
+44
View File
@@ -0,0 +1,44 @@
const ChainedMap = require('./ChainedMap');
const Rule = require('./Rule');
module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.rules = new ChainedMap(this);
this.defaultRules = new ChainedMap(this);
this.extend(['noParse']);
}
defaultRule(name) {
return this.defaultRules.getOrCompute(name, () => new Rule(this, name));
}
rule(name) {
return this.rules.getOrCompute(name, () => new Rule(this, name));
}
toConfig() {
return this.clean(
Object.assign(this.entries() || {}, {
defaultRules: this.defaultRules.values().map(r => r.toConfig()),
rules: this.rules.values().map(r => r.toConfig()),
}),
);
}
merge(obj, omit = []) {
if (!omit.includes('rule') && 'rule' in obj) {
Object.keys(obj.rule).forEach(name =>
this.rule(name).merge(obj.rule[name]),
);
}
if (!omit.includes('defaultRule') && 'defaultRule' in obj) {
Object.keys(obj.defaultRule).forEach(name =>
this.defaultRule(name).merge(obj.defaultRule[name]),
);
}
return super.merge(obj, ['rule', 'defaultRule']);
}
};
+53
View File
@@ -0,0 +1,53 @@
const ChainedMap = require('./ChainedMap');
const Plugin = require('./Plugin');
module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.minimizers = new ChainedMap(this);
this.extend([
'concatenateModules',
'flagIncludedChunks',
'mergeDuplicateChunks',
'minimize',
'namedChunks',
'namedModules',
'nodeEnv',
'noEmitOnErrors',
'occurrenceOrder',
'portableRecords',
'providedExports',
'removeAvailableModules',
'removeEmptyChunks',
'runtimeChunk',
'sideEffects',
'splitChunks',
'usedExports',
]);
}
minimizer(name) {
return this.minimizers.getOrCompute(
name,
() => new Plugin(this, name, 'optimization.minimizer'),
);
}
toConfig() {
return this.clean(
Object.assign(this.entries() || {}, {
minimizer: this.minimizers.values().map(plugin => plugin.toConfig()),
}),
);
}
merge(obj, omit = []) {
if (!omit.includes('minimizer') && 'minimizer' in obj) {
Object.keys(obj.minimizer).forEach(name =>
this.minimizer(name).merge(obj.minimizer[name]),
);
}
return super.merge(obj, [...omit, 'minimizer']);
}
};
+40
View File
@@ -0,0 +1,40 @@
module.exports = Class =>
class extends Class {
before(name) {
if (this.__after) {
throw new Error(
`Unable to set .before(${JSON.stringify(
name,
)}) with existing value for .after()`,
);
}
this.__before = name;
return this;
}
after(name) {
if (this.__before) {
throw new Error(
`Unable to set .after(${JSON.stringify(
name,
)}) with existing value for .before()`,
);
}
this.__after = name;
return this;
}
merge(obj, omit = []) {
if (obj.before) {
this.before(obj.before);
}
if (obj.after) {
this.after(obj.after);
}
return super.merge(obj, [...omit, 'before', 'after']);
}
};
+39
View File
@@ -0,0 +1,39 @@
const ChainedMap = require('./ChainedMap');
module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.extend([
'auxiliaryComment',
'chunkCallbackName',
'chunkFilename',
'chunkLoadTimeout',
'crossOriginLoading',
'devtoolFallbackModuleFilenameTemplate',
'devtoolLineToLine',
'devtoolModuleFilenameTemplate',
'devtoolNamespace',
'filename',
'globalObject',
'hashDigest',
'hashDigestLength',
'hashFunction',
'hashSalt',
'hotUpdateChunkFilename',
'hotUpdateFunction',
'hotUpdateMainFilename',
'jsonpFunction',
'library',
'libraryExport',
'libraryTarget',
'path',
'pathinfo',
'publicPath',
'sourceMapFilename',
'sourcePrefix',
'strictModuleExceptionHandling',
'umdNamedDefine',
'webassemblyModuleFilename',
]);
}
};
+8
View File
@@ -0,0 +1,8 @@
const ChainedMap = require('./ChainedMap');
module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.extend(['assetFilter', 'hints', 'maxAssetSize', 'maxEntrypointSize']);
}
};
+73
View File
@@ -0,0 +1,73 @@
const ChainedMap = require('./ChainedMap');
const Orderable = require('./Orderable');
module.exports = Orderable(
class extends ChainedMap {
constructor(parent, name, type = 'plugin') {
super(parent);
this.name = name;
this.type = type;
this.extend(['init']);
this.init((Plugin, args = []) => {
if (typeof Plugin === 'function') {
return new Plugin(...args);
}
return Plugin;
});
}
use(plugin, args = []) {
return this.set('plugin', plugin).set('args', args);
}
tap(f) {
this.set('args', f(this.get('args') || []));
return this;
}
merge(obj, omit = []) {
if ('plugin' in obj) {
this.set('plugin', obj.plugin);
}
if ('args' in obj) {
this.set('args', obj.args);
}
return super.merge(obj, [...omit, 'args', 'plugin']);
}
toConfig() {
const init = this.get('init');
let plugin = this.get('plugin');
const args = this.get('args');
let pluginPath = null;
// Support using the path to a plugin rather than the plugin itself,
// allowing expensive require()s to be skipped in cases where the plugin
// or webpack configuration won't end up being used.
if (typeof plugin === 'string') {
pluginPath = plugin;
// eslint-disable-next-line global-require, import/no-dynamic-require
plugin = require(pluginPath);
}
const constructorName = plugin.__expression
? `(${plugin.__expression})`
: plugin.name;
const config = init(plugin, args);
Object.defineProperties(config, {
__pluginName: { value: this.name },
__pluginType: { value: this.type },
__pluginArgs: { value: args },
__pluginConstructorName: { value: constructorName },
__pluginPath: { value: pluginPath },
});
return config;
}
},
);
+74
View File
@@ -0,0 +1,74 @@
const ChainedMap = require('./ChainedMap');
const ChainedSet = require('./ChainedSet');
const Plugin = require('./Plugin');
module.exports = class extends ChainedMap {
constructor(parent) {
super(parent);
this.alias = new ChainedMap(this);
this.aliasFields = new ChainedSet(this);
this.descriptionFiles = new ChainedSet(this);
this.extensions = new ChainedSet(this);
this.mainFields = new ChainedSet(this);
this.mainFiles = new ChainedSet(this);
this.modules = new ChainedSet(this);
this.plugins = new ChainedMap(this);
this.extend([
'cachePredicate',
'cacheWithContext',
'concord',
'enforceExtension',
'enforceModuleExtension',
'symlinks',
'unsafeCache',
]);
}
plugin(name) {
return this.plugins.getOrCompute(
name,
() => new Plugin(this, name, 'resolve.plugin'),
);
}
toConfig() {
return this.clean(
Object.assign(this.entries() || {}, {
alias: this.alias.entries(),
aliasFields: this.aliasFields.values(),
descriptionFiles: this.descriptionFiles.values(),
extensions: this.extensions.values(),
mainFields: this.mainFields.values(),
mainFiles: this.mainFiles.values(),
modules: this.modules.values(),
plugins: this.plugins.values().map(plugin => plugin.toConfig()),
}),
);
}
merge(obj, omit = []) {
const omissions = [
'alias',
'aliasFields',
'descriptionFiles',
'extensions',
'mainFields',
'mainFiles',
'modules',
];
if (!omit.includes('plugin') && 'plugin' in obj) {
Object.keys(obj.plugin).forEach(name =>
this.plugin(name).merge(obj.plugin[name]),
);
}
omissions.forEach(key => {
if (!omit.includes(key) && key in obj) {
this[key].merge(obj[key]);
}
});
return super.merge(obj, [...omit, ...omissions, 'plugin']);
}
};
+34
View File
@@ -0,0 +1,34 @@
const Resolve = require('./Resolve');
const ChainedSet = require('./ChainedSet');
module.exports = class extends Resolve {
constructor(parent) {
super(parent);
this.moduleExtensions = new ChainedSet(this);
this.packageMains = new ChainedSet(this);
}
toConfig() {
return this.clean(
Object.assign(
{
moduleExtensions: this.moduleExtensions.values(),
packageMains: this.packageMains.values(),
},
super.toConfig(),
),
);
}
merge(obj, omit = []) {
const omissions = ['moduleExtensions', 'packageMains'];
omissions.forEach(key => {
if (!omit.includes(key) && key in obj) {
this[key].merge(obj[key]);
}
});
return super.merge(obj, [...omit, ...omissions]);
}
};
+105
View File
@@ -0,0 +1,105 @@
const ChainedMap = require('./ChainedMap');
const ChainedSet = require('./ChainedSet');
const Orderable = require('./Orderable');
const Use = require('./Use');
const Rule = Orderable(
class extends ChainedMap {
constructor(parent, name) {
super(parent);
this.name = name;
this.names = [];
let rule = this;
while (rule instanceof Rule) {
this.names.unshift(rule.name);
rule = rule.parent;
}
this.uses = new ChainedMap(this);
this.include = new ChainedSet(this);
this.exclude = new ChainedSet(this);
this.oneOfs = new ChainedMap(this);
this.extend([
'enforce',
'issuer',
'parser',
'resource',
'resourceQuery',
'sideEffects',
'test',
'type',
]);
}
use(name) {
return this.uses.getOrCompute(name, () => new Use(this, name));
}
oneOf(name) {
return this.oneOfs.getOrCompute(name, () => new Rule(this, name));
}
pre() {
return this.enforce('pre');
}
post() {
return this.enforce('post');
}
toConfig() {
const config = this.clean(
Object.assign(this.entries() || {}, {
include: this.include.values(),
exclude: this.exclude.values(),
oneOf: this.oneOfs.values().map(oneOf => oneOf.toConfig()),
use: this.uses.values().map(use => use.toConfig()),
}),
);
Object.defineProperties(config, {
__ruleNames: { value: this.names },
});
return config;
}
merge(obj, omit = []) {
if (!omit.includes('include') && 'include' in obj) {
this.include.merge(obj.include);
}
if (!omit.includes('exclude') && 'exclude' in obj) {
this.exclude.merge(obj.exclude);
}
if (!omit.includes('use') && 'use' in obj) {
Object.keys(obj.use).forEach(name =>
this.use(name).merge(obj.use[name]),
);
}
if (!omit.includes('oneOf') && 'oneOf' in obj) {
Object.keys(obj.oneOf).forEach(name =>
this.oneOf(name).merge(obj.oneOf[name]),
);
}
if (!omit.includes('test') && 'test' in obj) {
this.test(obj.test instanceof RegExp ? obj.test : new RegExp(obj.test));
}
return super.merge(obj, [
...omit,
'include',
'exclude',
'use',
'oneOf',
'test',
]);
}
},
);
module.exports = Rule;
+41
View File
@@ -0,0 +1,41 @@
const merge = require('deepmerge');
const ChainedMap = require('./ChainedMap');
const Orderable = require('./Orderable');
module.exports = Orderable(
class extends ChainedMap {
constructor(parent, name) {
super(parent);
this.name = name;
this.extend(['loader', 'options']);
}
tap(f) {
this.options(f(this.get('options')));
return this;
}
merge(obj, omit = []) {
if (!omit.includes('loader') && 'loader' in obj) {
this.loader(obj.loader);
}
if (!omit.includes('options') && 'options' in obj) {
this.options(merge(this.store.get('options') || {}, obj.options));
}
return super.merge(obj, [...omit, 'loader', 'options']);
}
toConfig() {
const config = this.clean(this.entries() || {});
Object.defineProperties(config, {
__useName: { value: this.name },
__ruleNames: { value: this.parent && this.parent.names },
});
return config;
}
},
);
+296
View File
@@ -0,0 +1,296 @@
import * as webpack from 'webpack';
import * as https from 'https';
export = Config;
declare namespace __Config {
class Chained<Parent> {
end(): Parent;
}
class TypedChainedMap<Parent, Value> extends Chained<Parent> {
clear(): this;
delete(key: string): this;
has(key: string): boolean;
get(key: string): Value;
set(key: string, value: Value): this;
merge(obj: { [key: string]: Value }): this;
entries(): { [key: string]: Value };
values(): Value[];
when(condition: boolean, trueBrancher: (obj: this) => void, falseBrancher?: (obj: this) => void): this;
}
class ChainedMap<Parent> extends TypedChainedMap<Parent, any> {}
class TypedChainedSet<Parent, Value> extends Chained<Parent> {
add(value: Value): this;
prepend(value: Value): this;
clear(): this;
delete(key: string): this;
has(key: string): boolean;
merge(arr: Value[]): this;
values(): Value[];
when(condition: boolean, trueBrancher: (obj: this) => void, falseBrancher?: (obj: this) => void): this;
}
class ChainedSet<Parent> extends TypedChainedSet<Parent, any> {}
}
declare class Config extends __Config.ChainedMap<void> {
devServer: Config.DevServer;
entryPoints: Config.TypedChainedMap<Config, Config.EntryPoint>;
module: Config.Module;
node: Config.ChainedMap<this>;
output: Config.Output;
optimization: Config.Optimization;
performance: Config.Performance;
plugins: Config.Plugins<this>;
resolve: Config.Resolve;
resolveLoader: Config.ResolveLoader;
amd(value: { [moduleName: string]: boolean }): this;
bail(value: boolean): this;
cache(value: boolean | any): this;
devtool(value: Config.DevTool): this;
context(value: string): this;
externals(value: webpack.ExternalsElement | webpack.ExternalsElement[]): this;
loader(value: any): this;
name(value: string): this;
mode(value: 'none' | 'development' | 'production') : this;
parallelism(value: number) : this;
profile(value: boolean): this;
recordsPath(value: string): this;
recordsInputPath(value: string): this;
recordsOutputPath(value: string): this;
stats(value: webpack.Options.Stats): this;
target(value: string): this;
watch(value: boolean): this;
watchOptions(value: webpack.Options.WatchOptions): this;
entry(name: string): Config.EntryPoint;
plugin(name: string): Config.Plugin<this>;
toConfig(): webpack.Configuration;
}
declare namespace Config {
class Chained<Parent> extends __Config.Chained<Parent> {}
class TypedChainedMap<Parent, Value> extends __Config.TypedChainedMap<Parent, Value> {}
class ChainedMap<Parent> extends __Config.TypedChainedMap<Parent, any> {}
class TypedChainedSet<Parent, Value> extends __Config.TypedChainedSet<Parent, Value> {}
class ChainedSet<Parent> extends __Config.TypedChainedSet<Parent, any> {}
class Plugins<Parent> extends TypedChainedMap<Parent, Plugin<Parent>> {}
class Plugin<Parent> extends ChainedMap<Parent> implements Orderable {
init(value: (plugin: PluginClass, args: any[]) => webpack.Plugin): this;
use(plugin: PluginClass, args?: any[]): this;
tap(f: (args: any[]) => any[]): this;
// Orderable
before(name: string): this;
after(name: string): this;
}
class Module extends ChainedMap<Config> {
rules: TypedChainedMap<this, Rule>;
rule(name: string): Rule;
noParse(noParse: RegExp | RegExp[] | ((contentPath: string) => boolean)): this;
}
class Output extends ChainedMap<Config> {
auxiliaryComment(value: string | { [comment:string]: string }): this;
chunkFilename(value: string): this;
chunkLoadTimeout(value: number): this;
crossOriginLoading(value: boolean | string): this;
filename(value: string): this;
library(value: string): this;
libraryExport(value: string | string[]): this;
libraryTarget(value: string): this;
devtoolFallbackModuleFilenameTemplate(value: any): this;
devtoolLineToLine(value: any): this;
devtoolModuleFilenameTemplate(value: any): this;
globalObject(value: string): this;
hashFunction(value: string): this;
hashDigest(value: string): this;
hashDigestLength(value: number): this;
hashSalt(value: any): this;
hotUpdateChunkFilename(value: string): this;
hotUpdateFunction(value: any): this;
hotUpdateMainFilename(value: string): this;
jsonpFunction(value: string): this;
path(value: string): this;
pathinfo(value: boolean): this;
publicPath(value: string): this;
sourceMapFilename(value: string): this;
sourcePrefix(value: string): this;
strictModuleExceptionHandling(value: boolean): this;
umdNamedDefine(value: boolean): this;
}
class DevServer extends ChainedMap<Config> {
allowedHosts: TypedChainedSet<this, string>;
bonjour(value: boolean): this;
clientLogLevel(value: 'none' | 'error' | 'warning' | 'info'): this;
color(value: boolean): this;
compress(value: boolean): this;
contentBase(value: boolean | string | string[]): this;
disableHostCheck(value: boolean): this;
filename(value: string): this;
headers(value: { [header: string]: string }): this;
historyApiFallback(value: boolean | any): this;
host(value: string): this;
hot(value: boolean): this;
hotOnly(value: boolean): this;
https(value: boolean | https.ServerOptions): this;
inline(value: boolean): this;
info(value: boolean): this;
lazy(value: boolean): this;
noInfo(value: boolean): this;
open(value: boolean): this;
overlay(value: boolean | { warnings?: boolean, errors?: boolean }): this;
pfx(value: string): this;
pfxPassphrase(value: string): this;
port(value: number): this;
progress(value: boolean): this;
proxy(value: any): this;
public(value: string): this;
publicPath(publicPath: string): this;
quiet(value: boolean): this;
setup(value: (expressApp: any) => void): this;
socket(value: string): this;
staticOptions(value: any): this;
stats(value: webpack.Options.Stats): this;
stdin(value: boolean): this;
useLocalIp(value: boolean): this;
watchContentBase(value: boolean): this;
watchOptions(value: any): this;
}
class Performance extends ChainedMap<Config> {
hints(value: boolean | 'error' | 'warning'): this;
maxEntrypointSize(value: number): this;
maxAssetSize(value: number): this;
assetFilter(value: (assetFilename: string) => boolean): this;
}
class EntryPoint extends TypedChainedSet<Config, string> {}
class Resolve extends ChainedMap<Config> {
alias: TypedChainedMap<this, string>;
aliasFields: TypedChainedSet<this, string>;
descriptionFiles: TypedChainedSet<this, string>;
extensions: TypedChainedSet<this, string>;
mainFields: TypedChainedSet<this, string>;
mainFiles: TypedChainedSet<this, string>;
modules: TypedChainedSet<this, string>;
plugins: TypedChainedMap<this, Plugin<this>>;
enforceExtension(value: boolean): this;
enforceModuleExtension(value: boolean): this;
unsafeCache(value: boolean | RegExp | RegExp[]): this;
symlinks(value: boolean): this;
cachePredicate(value: (data: { path: string, request: string }) => boolean): this;
cacheWithContext(value: boolean): this;
plugin(name: string): Plugin<this>;
}
class ResolveLoader extends Resolve {
moduleExtensions: ChainedSet<this>;
packageMains: ChainedSet<this>
}
class Rule extends ChainedMap<Module> {
oneOfs: TypedChainedMap<this, OneOf>;
uses: TypedChainedMap<this, Use>;
include: TypedChainedSet<this, webpack.Condition>;
exclude: TypedChainedSet<this, webpack.Condition>;
parser(value: { [optName: string]: any }): this;
test(value: webpack.Condition | webpack.Condition[]): this;
type(value: 'javascript/auto' | 'javascript/dynamic' | 'javascript/esm' | 'json' | 'webassembly/experimental'): this;
enforce(value: 'pre' | 'post'): this;
use(name: string): Use;
oneOf(name: string): OneOf;
pre(): this;
post(): this;
}
class Optimization extends ChainedMap<Config> {
concatenateModules(value: boolean): this;
flagIncludedChunks(value: boolean): this;
mergeDuplicateChunks(value: boolean): this;
minimize(value: boolean): this;
minimizer(name: string): Config.Plugin<this>;
namedChunks(value: boolean): this;
namedModules(value: boolean): this;
nodeEnv(value: boolean | string): this;
noEmitOnErrors(value: boolean): this;
occurrenceOrder(value: boolean): this;
portableRecords(value: boolean): this;
providedExports(value: boolean): this;
removeAvailableModules(value: boolean): this;
removeEmptyChunks(value: boolean): this;
runtimeChunk(value: boolean | "single" | "multiple" | RuntimeChunk): this;
sideEffects(value: boolean): this;
splitChunks(value: SplitChunksOptions): this;
usedExports(value: boolean): this;
}
interface RuntimeChunk {
name: string | RuntimeChunkFunction;
}
type RuntimeChunkFunction = (entryPoint: EntryPoint) => string;
interface SplitChunksOptions { [name: string]: any; }
interface LoaderOptions { [name: string]: any; }
class Use<Parent = Rule> extends ChainedMap<Parent> implements Orderable {
loader(value: string): this;
options(value: LoaderOptions): this;
tap(f: (options: LoaderOptions) => LoaderOptions): this;
// Orderable
before(name: string): this;
after(name: string): this;
}
class OneOf extends ChainedMap<Rule> implements Orderable {
resourceQuery(value: webpack.Condition | webpack.Condition[]): this;
use(name: string): Use<this>;
// Orderable
before(name: string): this;
after(name: string): this;
}
type DevTool = 'eval' | 'inline-source-map' | 'cheap-eval-source-map' | 'cheap-source-map' |
'cheap-module-eval-source-map' | 'cheap-module-source-map' | 'eval-source-map' | 'source-map' |
'nosources-source-map' | 'hidden-source-map' | 'nosources-source-map' | '@eval' |
'@inline-source-map' | '@cheap-eval-source-map' | '@cheap-source-map' |
'@cheap-module-eval-source-map' | '@cheap-module-source-map' | '@eval-source-map' |
'@source-map' | '@nosources-source-map' | '@hidden-source-map' | '@nosources-source-map' |
'#eval' | '#inline-source-map' | '#cheap-eval-source-map' | '#cheap-source-map' |
'#cheap-module-eval-source-map' | '#cheap-module-source-map' | '#eval-source-map' |
'#source-map' | '#nosources-source-map' | '#hidden-source-map' | '#nosources-source-map' |
'#@eval' | '#@inline-source-map' | '#@cheap-eval-source-map' | '#@cheap-source-map' |
'#@cheap-module-eval-source-map' | '#@cheap-module-source-map' | '#@eval-source-map' |
'#@source-map' | '#@nosources-source-map' | '#@hidden-source-map' | '#@nosources-source-map' |
boolean;
interface PluginClass {
new (...opts: any[]): webpack.Plugin;
}
interface Orderable {
before(name: string): this;
after(name: string): this;
}
}