node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+968
View File
@@ -0,0 +1,968 @@
<a name="3.3.0"></a>
# 3.3.0 (2019-03-15)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.3...v3.3.0)
## New Features
* use webpack.config as default name in dev scaffold ([385a672](https://github.com/webpack/webpack-cli/commit/385a672))
* only display once a week ([b6199e5](https://github.com/webpack/webpack-cli/commit/b6199e5))
* add util to run-and-get watch proc ([1d2ccd5](https://github.com/webpack/webpack-cli/commit/1d2ccd5))
* add test-util to append data to file ([e9e1dcb](https://github.com/webpack/webpack-cli/commit/e9e1dcb))
* log: clean single line logs ([5d2284b](https://github.com/webpack/webpack-cli/commit/5d2284b))
* log: add gitignore ([7c830b5](https://github.com/webpack/webpack-cli/commit/7c830b5))
* log: make log package ([df7c224](https://github.com/webpack/webpack-cli/commit/df7c224))
* log: add clrscr function ([11b3bff](https://github.com/webpack/webpack-cli/commit/11b3bff))
* log: few changes ([bc32727](https://github.com/webpack/webpack-cli/commit/bc32727))
* log: add newline for title ([4047213](https://github.com/webpack/webpack-cli/commit/4047213))
* log: remove unwanted commits ([c088f3e](https://github.com/webpack/webpack-cli/commit/c088f3e))
* log: task based custom loggers ([2c43a41](https://github.com/webpack/webpack-cli/commit/2c43a41))
## Chore
* revise typo ([a14908e](https://github.com/webpack/webpack-cli/commit/a14908e))
* deps: @std/esm -> esm ([a8b46bf](https://github.com/webpack/webpack-cli/commit/a8b46bf))
* remove commit lint from travis ([ccec130](https://github.com/webpack/webpack-cli/commit/ccec130))
* revise contributing location ([13a3a87](https://github.com/webpack/webpack-cli/commit/13a3a87))
* deps: fix vulnerabilities ([c632d1a](https://github.com/webpack/webpack-cli/commit/c632d1a))
* tests: skipping broken test ([f7b6b3a](https://github.com/webpack/webpack-cli/commit/f7b6b3a))
* rewrite changelog ([62ab32d](https://github.com/webpack/webpack-cli/commit/62ab32d))
* v.3.2.3 ([70138b7](https://github.com/webpack/webpack-cli/commit/70138b7))
* v.3.2.2 ([24b6387](https://github.com/webpack/webpack-cli/commit/24b6387))
* update tests ([70bfbd9](https://github.com/webpack/webpack-cli/commit/70bfbd9))
* one liner ([0f55d5a](https://github.com/webpack/webpack-cli/commit/0f55d5a))
* one liner after log ([6d8fb67](https://github.com/webpack/webpack-cli/commit/6d8fb67))
* watch: remove console log ([0952317](https://github.com/webpack/webpack-cli/commit/0952317))
* v.3.2.1 ([54805ae](https://github.com/webpack/webpack-cli/commit/54805ae))
* dependency: add `node-ts` as devDependency ([#724](https://github.com/webpack/webpack-cli/pull/724))
## Docs
* scaffolding: lowercase Webpack ([d19c1f7](https://github.com/webpack/webpack-cli/commit/d19c1f7))
* scaffolding: fix typos ([b94b0de](https://github.com/webpack/webpack-cli/commit/b94b0de))
* scaffolding: improve grammar ([6b79072](https://github.com/webpack/webpack-cli/commit/6b79072))
* add lerna badge in README ([#786](https://github.com/webpack/webpack-cli/pull/786))
* contributing: refactor & formatting ([1042cb2](https://github.com/webpack/webpack-cli/commit/1042cb2))
* contributing: improve formatting ([47fcd7f](https://github.com/webpack/webpack-cli/commit/47fcd7f))
* contributing: : at the end of paragraphs ([48d65fd](https://github.com/webpack/webpack-cli/commit/48d65fd))
* contributing: update instructions to run individual tests ([b7cca58](https://github.com/webpack/webpack-cli/commit/b7cca58))
* contributing: update instructions to run individual tests ([bc0297a](https://github.com/webpack/webpack-cli/commit/bc0297a))
* contributing: add yarn before running jest ([126cf55](https://github.com/webpack/webpack-cli/commit/126cf55))
* contributing: commands to install jest globally ([18b7c2e](https://github.com/webpack/webpack-cli/commit/18b7c2e))
* contributing: fixes typo ([c458380](https://github.com/webpack/webpack-cli/commit/c458380))
* contributing: improves formatting ([abac823](https://github.com/webpack/webpack-cli/commit/abac823))
* contributing: adds prebuild instructions ([81cb46a](https://github.com/webpack/webpack-cli/commit/81cb46a))
* readme: add downloads badge ([dc2423c](https://github.com/webpack/webpack-cli/commit/dc2423c))
* scaffold: add link option for local ([f8424be](https://github.com/webpack/webpack-cli/commit/f8424be))
* scaffold: Add installation guide for packages/webpack-scaffold ([#727](https://github.com/webpack/webpack-cli/pull/727))
* scaffolding: fix typo ([98818a1](https://github.com/webpack/webpack-cli/commit/98818a1))
* scaffolding: improve description & formatting ([0f657d0](https://github.com/webpack/webpack-cli/commit/0f657d0))
* scaffolding: fix links ([e11c524](https://github.com/webpack/webpack-cli/commit/e11c524))
* scaffolding: add yarn example ([d47eea0](https://github.com/webpack/webpack-cli/commit/d47eea0))
* scaffolding: fix typo ([87ba169](https://github.com/webpack/webpack-cli/commit/87ba169))
* scaffolding: improved structure, formatting, typos ([8949f82](https://github.com/webpack/webpack-cli/commit/8949f82))
* init documentaion ([4b130bb](https://github.com/webpack/webpack-cli/commit/4b130bb))
* rename Webpack to webpack ([900c13e](https://github.com/webpack/webpack-cli/commit/900c13e))
* init documentaion ([14d2b47](https://github.com/webpack/webpack-cli/commit/14d2b47))
## Fix
* bin: use compiler.close API correctly for stats ([568161d](https://github.com/webpack/webpack-cli/commit/568161d))
* bin: extension detection ([#724](https://github.com/webpack/webpack-cli/pull/724))
* init: lint code ([20aab48](https://github.com/webpack/webpack-cli/commit/20aab48))
* init: support global installation ([1cb0166](https://github.com/webpack/webpack-cli/commit/1cb0166))
* init: revert to local installation ([48b3b23](https://github.com/webpack/webpack-cli/commit/48b3b23))
* init: update prompt command ([c1c0739](https://github.com/webpack/webpack-cli/commit/c1c0739))
* init: update prompt command ([1cab3cb](https://github.com/webpack/webpack-cli/commit/1cab3cb))
* readme: remove old dependency status link ([4df0000](https://github.com/webpack/webpack-cli/commit/4df0000))
* readme: add fallback badge for dependency status ([0e3753b](https://github.com/webpack/webpack-cli/commit/0e3753b))
* tests: remove snapshot for static compilation ([54a3ac4](https://github.com/webpack/webpack-cli/commit/54a3ac4))
* tests: remove snapshot for static compilation ([3af0948](https://github.com/webpack/webpack-cli/commit/3af0948))
* tests: update jest ([d195774](https://github.com/webpack/webpack-cli/commit/d195774))
* close compiler, own sh script and output clearing ([6ded275](https://github.com/webpack/webpack-cli/commit/6ded275))
* failing test ([88888bb](https://github.com/webpack/webpack-cli/commit/88888bb))
* failing test ([986472a](https://github.com/webpack/webpack-cli/commit/986472a))
* test: fix travis ts build ([22d3acc](https://github.com/webpack/webpack-cli/commit/22d3acc))
## Tests
* azure pipelines ([c9c3fea](https://github.com/webpack/webpack-cli/commit/c9c3fea))
* bin: add `webpack.config.ts` related test ([#724](https://github.com/webpack/webpack-cli/pull/724))
* bin: add `webpack.config.babel.js` related test ([#724](https://github.com/webpack/webpack-cli/pull/724))
* module: use extractSummary ([7bde073](https://github.com/webpack/webpack-cli/commit/7bde073))
* watch: use copyFile functionality ([c61fe92](https://github.com/webpack/webpack-cli/commit/c61fe92))
* add copyFile function in test-utils ([1b21e81](https://github.com/webpack/webpack-cli/commit/1b21e81))
* config-file: use extractSummary ([7554fe7](https://github.com/webpack/webpack-cli/commit/7554fe7))
* config-name: use extractSummary ([3e30a57](https://github.com/webpack/webpack-cli/commit/3e30a57))
* env: use extractSummary ([aa0cf25](https://github.com/webpack/webpack-cli/commit/aa0cf25))
* fix: fix failing tests ([5669311](https://github.com/webpack/webpack-cli/commit/5669311))
* fix: fix failing tests ([f1f7db1](https://github.com/webpack/webpack-cli/commit/f1f7db1))
* help: use extractSummary ([0ba72c4](https://github.com/webpack/webpack-cli/commit/0ba72c4))
* watch: use switch pattern for verbosity off ([c00386b](https://github.com/webpack/webpack-cli/commit/c00386b))
* watch: hash assertion for single-config-opt ([55632d6](https://github.com/webpack/webpack-cli/commit/55632d6))
* watch: hash assertion for single-config ([48f34d1](https://github.com/webpack/webpack-cli/commit/48f34d1))
* watch: hash assertion for multi-config-watch-opt ([6dd2327](https://github.com/webpack/webpack-cli/commit/6dd2327))
* watch: hash assertion multi-config ([6b4d339](https://github.com/webpack/webpack-cli/commit/6b4d339))
* watch: hash assertion info-verbosity-verbose ([42e5ee8](https://github.com/webpack/webpack-cli/commit/42e5ee8))
* watch: remove test.only for info-verbosity-off ([675d5c0](https://github.com/webpack/webpack-cli/commit/675d5c0))
* improve appendFile test-case ([18bde78](https://github.com/webpack/webpack-cli/commit/18bde78))
* remove eslint comment for requireReturn ([be7b259](https://github.com/webpack/webpack-cli/commit/be7b259))
* watch: test failure using done(error) ([46d2e37](https://github.com/webpack/webpack-cli/commit/46d2e37))
* watch: use native require first ([20e8579](https://github.com/webpack/webpack-cli/commit/20e8579))
* watch: use better comments ([b6efe2d](https://github.com/webpack/webpack-cli/commit/b6efe2d))
* add type to appendDataIfFileExists util ([f853302](https://github.com/webpack/webpack-cli/commit/f853302))
* make comment clear about fs.copyFileSync ([d1d3d02](https://github.com/webpack/webpack-cli/commit/d1d3d02))
* use 10E6 instead of 10e6 ([c9c5832](https://github.com/webpack/webpack-cli/commit/c9c5832))
* bin: add `.babelrc` to webpack-babel-config test ([#724](https://github.com/webpack/webpack-cli/pull/724))
* bin-cases: expose extractSummary as function ([73714f5](https://github.com/webpack/webpack-cli/commit/73714f5))
* config-type: use extractSummary ([ed36260](https://github.com/webpack/webpack-cli/commit/ed36260))
* entry: use extractSummary ([745a369](https://github.com/webpack/webpack-cli/commit/745a369))
* errors: use extractSummary ([3c8628c](https://github.com/webpack/webpack-cli/commit/3c8628c))
* fix: fix failing tests ([7cb531b](https://github.com/webpack/webpack-cli/commit/7cb531b))
* fix: fix failing tests ([a967485](https://github.com/webpack/webpack-cli/commit/a967485))
* mode: use extractSummary ([3277d41](https://github.com/webpack/webpack-cli/commit/3277d41))
* output: use extractSummary ([cb60b15](https://github.com/webpack/webpack-cli/commit/cb60b15))
* plugins: use extractSummary ([02e08dc](https://github.com/webpack/webpack-cli/commit/02e08dc))
* silent: use extractSummary ([ea89a82](https://github.com/webpack/webpack-cli/commit/ea89a82))
* stats: use extractSummary ([7f4e504](https://github.com/webpack/webpack-cli/commit/7f4e504))
* watch: hash assertion for info-verbosity-off ([e0a0d97](https://github.com/webpack/webpack-cli/commit/e0a0d97))
* watch: use extractSummary ([8357dbc](https://github.com/webpack/webpack-cli/commit/8357dbc))
## Misc
* Correction of the webpack-merge configuration ([2ed8c60](https://github.com/webpack/webpack-cli/commit/2ed8c60))
* replace opencollective with light vers ([848bf4b](https://github.com/webpack/webpack-cli/commit/848bf4b))
<a name="3.2.2"></a>
# 3.2.2 (2019-02-05)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.3...v3.2.2)
## New Features
* only display once a week ([b6199e5](https://github.com/webpack/webpack-cli/commit/b6199e5))
* add util to run-and-get watch proc ([1d2ccd5](https://github.com/webpack/webpack-cli/commit/1d2ccd5))
* add test-util to append data to file ([e9e1dcb](https://github.com/webpack/webpack-cli/commit/e9e1dcb))
* log: clean single line logs ([5d2284b](https://github.com/webpack/webpack-cli/commit/5d2284b))
* log: add gitignore ([7c830b5](https://github.com/webpack/webpack-cli/commit/7c830b5))
* log: make log package ([df7c224](https://github.com/webpack/webpack-cli/commit/df7c224))
* log: add clrscr function ([11b3bff](https://github.com/webpack/webpack-cli/commit/11b3bff))
* log: few changes ([bc32727](https://github.com/webpack/webpack-cli/commit/bc32727))
* log: add newline for title ([4047213](https://github.com/webpack/webpack-cli/commit/4047213))
* log: remove unwanted commits ([c088f3e](https://github.com/webpack/webpack-cli/commit/c088f3e))
* log: task based custom loggers ([2c43a41](https://github.com/webpack/webpack-cli/commit/2c43a41))
## Chore
* v.3.2.3 ([70138b7](https://github.com/webpack/webpack-cli/commit/70138b7))
* v.3.2.2 ([24b6387](https://github.com/webpack/webpack-cli/commit/24b6387))
* update tests ([70bfbd9](https://github.com/webpack/webpack-cli/commit/70bfbd9))
* one liner ([0f55d5a](https://github.com/webpack/webpack-cli/commit/0f55d5a))
* one liner after log ([6d8fb67](https://github.com/webpack/webpack-cli/commit/6d8fb67))
* watch: remove console log ([0952317](https://github.com/webpack/webpack-cli/commit/0952317))
* v.3.2.1 ([54805ae](https://github.com/webpack/webpack-cli/commit/54805ae))
* dependency: add `node-ts` as devDependency ([#724](https://github.com/webpack/webpack-cli/pull/724))
## Docs
* init documentaion ([14d2b47](https://github.com/webpack/webpack-cli/commit/14d2b47))
* scaffold: Add installation guide for packages/webpack-scaffold ([#727](https://github.com/webpack/webpack-cli/pull/727))
## Fix
* close compiler, own sh script and output clearing ([6ded275](https://github.com/webpack/webpack-cli/commit/6ded275))
* bin: extension detection ([#724](https://github.com/webpack/webpack-cli/pull/724))
* readme: remove old dependency status link ([4df0000](https://github.com/webpack/webpack-cli/commit/4df0000))
* readme: add fallback badge for dependency status ([0e3753b](https://github.com/webpack/webpack-cli/commit/0e3753b))
* failing test ([88888bb](https://github.com/webpack/webpack-cli/commit/88888bb))
* test: fix travis ts build ([22d3acc](https://github.com/webpack/webpack-cli/commit/22d3acc))
## Tests
* azure pipelines ([c9c3fea](https://github.com/webpack/webpack-cli/commit/c9c3fea))
* bin: add `webpack.config.ts` related test ([#724](https://github.com/webpack/webpack-cli/pull/724))
* module: use extractSummary ([7bde073](https://github.com/webpack/webpack-cli/commit/7bde073))
* watch: use copyFile functionality ([c61fe92](https://github.com/webpack/webpack-cli/commit/c61fe92))
* add copyFile function in test-utils ([1b21e81](https://github.com/webpack/webpack-cli/commit/1b21e81))
* bin: add `webpack.config.babel.js` related test ([#724](https://github.com/webpack/webpack-cli/pull/724))
* config-file: use extractSummary ([7554fe7](https://github.com/webpack/webpack-cli/commit/7554fe7))
* config-name: use extractSummary ([3e30a57](https://github.com/webpack/webpack-cli/commit/3e30a57))
* env: use extractSummary ([aa0cf25](https://github.com/webpack/webpack-cli/commit/aa0cf25))
* fix: fix failing tests ([5669311](https://github.com/webpack/webpack-cli/commit/5669311))
* help: use extractSummary ([0ba72c4](https://github.com/webpack/webpack-cli/commit/0ba72c4))
* watch: use switch pattern for verbosity off ([c00386b](https://github.com/webpack/webpack-cli/commit/c00386b))
* watch: hash assertion for single-config-opt ([55632d6](https://github.com/webpack/webpack-cli/commit/55632d6))
* watch: hash assertion for single-config ([48f34d1](https://github.com/webpack/webpack-cli/commit/48f34d1))
* watch: hash assertion for multi-config-watch-opt ([6dd2327](https://github.com/webpack/webpack-cli/commit/6dd2327))
* watch: hash assertion multi-config ([6b4d339](https://github.com/webpack/webpack-cli/commit/6b4d339))
* watch: hash assertion info-verbosity-verbose ([42e5ee8](https://github.com/webpack/webpack-cli/commit/42e5ee8))
* watch: remove test.only for info-verbosity-off ([675d5c0](https://github.com/webpack/webpack-cli/commit/675d5c0))
* improve appendFile test-case ([18bde78](https://github.com/webpack/webpack-cli/commit/18bde78))
* remove eslint comment for requireReturn ([be7b259](https://github.com/webpack/webpack-cli/commit/be7b259))
* watch: test failure using done(error) ([46d2e37](https://github.com/webpack/webpack-cli/commit/46d2e37))
* watch: use native require first ([20e8579](https://github.com/webpack/webpack-cli/commit/20e8579))
* watch: use better comments ([b6efe2d](https://github.com/webpack/webpack-cli/commit/b6efe2d))
* add type to appendDataIfFileExists util ([f853302](https://github.com/webpack/webpack-cli/commit/f853302))
* make comment clear about fs.copyFileSync ([d1d3d02](https://github.com/webpack/webpack-cli/commit/d1d3d02))
* use 10E6 instead of 10e6 ([c9c5832](https://github.com/webpack/webpack-cli/commit/c9c5832))
* bin: add `.babelrc` to webpack-babel-config test ([#724](https://github.com/webpack/webpack-cli/pull/724))
* bin-cases: expose extractSummary as function ([73714f5](https://github.com/webpack/webpack-cli/commit/73714f5))
* config-type: use extractSummary ([ed36260](https://github.com/webpack/webpack-cli/commit/ed36260))
* entry: use extractSummary ([745a369](https://github.com/webpack/webpack-cli/commit/745a369))
* errors: use extractSummary ([3c8628c](https://github.com/webpack/webpack-cli/commit/3c8628c))
* fix: fix failing tests ([7cb531b](https://github.com/webpack/webpack-cli/commit/7cb531b))
* mode: use extractSummary ([3277d41](https://github.com/webpack/webpack-cli/commit/3277d41))
* output: use extractSummary ([cb60b15](https://github.com/webpack/webpack-cli/commit/cb60b15))
* plugins: use extractSummary ([02e08dc](https://github.com/webpack/webpack-cli/commit/02e08dc))
* silent: use extractSummary ([ea89a82](https://github.com/webpack/webpack-cli/commit/ea89a82))
* stats: use extractSummary ([7f4e504](https://github.com/webpack/webpack-cli/commit/7f4e504))
* watch: hash assertion for info-verbosity-off ([e0a0d97](https://github.com/webpack/webpack-cli/commit/e0a0d97))
* watch: use extractSummary ([8357dbc](https://github.com/webpack/webpack-cli/commit/8357dbc))
## Misc
* Correction of the webpack-merge configuration ([2ed8c60](https://github.com/webpack/webpack-cli/commit/2ed8c60))
* replace opencollective with light vers ([848bf4b](https://github.com/webpack/webpack-cli/commit/848bf4b))
<a name="3.1.2"></a>
# 3.1.2 (2018-09-29)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v3.1.1...v3.1.2)
## Chore
* deps: upgrade husky ([#611](https://github.com/webpack/webpack-cli/pull/611))
* docs: update readme ([93ebcc2](https://github.com/webpack/webpack-cli/commit/93ebcc2))
* scripts: add commit script, cz-customizable ([#612](https://github.com/webpack/webpack-cli/pull/612))
## Docs
* init: update headers ([dc4ded9](https://github.com/webpack/webpack-cli/commit/dc4ded9))
* init: update init documentation ([2ccf9a9](https://github.com/webpack/webpack-cli/commit/2ccf9a9))
* readme: update webpack-cli to webpack CLI ([f3a225a](https://github.com/webpack/webpack-cli/commit/f3a225a))
* readme: change addons to scaffolds ([747aef9](https://github.com/webpack/webpack-cli/commit/747aef9))
* readme: update links ([f8187f1](https://github.com/webpack/webpack-cli/commit/f8187f1))
* readme: update README.md ([#614](https://github.com/webpack/webpack-cli/pull/614))
* readme: update Readme based on feedback ([da05c2f](https://github.com/webpack/webpack-cli/commit/da05c2f))
## Fix
* tapable: fix hook options ([9aed0dc](https://github.com/webpack/webpack-cli/commit/9aed0dc))
* replace test regex ([d4e1614](https://github.com/webpack/webpack-cli/commit/d4e1614))
<a name="3.1.1"></a>
# 3.1.1 (2018-09-23)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.1.0...v3.1.1)
## New Features
* migrate: CommonChunksPlugin to SplitChunksPlugin ([#558](https://github.com/webpack/webpack-cli/pull/558))
* types: types for packages ([#578](https://github.com/webpack/webpack-cli/pull/578))
## Chore
* ci: add commitlint when trying to commit ([#595](https://github.com/webpack/webpack-cli/pull/595))
* ci: Set up CI with Azure Pipelines ([89d3a19](https://github.com/webpack/webpack-cli/commit/89d3a19))
* ci: fix commitlint ([#592](https://github.com/webpack/webpack-cli/pull/592))
* ci: Add a status badge for the azure pipelines CI build ([#601](https://github.com/webpack/webpack-cli/pull/601))
* deps: resync package-lock, upgrade major version ([d892b4d](https://github.com/webpack/webpack-cli/commit/d892b4d))
* deps: Bump lerna version ([#583](https://github.com/webpack/webpack-cli/pull/583))
* deps: removing inquirer as default package ([#555](https://github.com/webpack/webpack-cli/pull/555))
* fix: fix clean all script ([6be0478](https://github.com/webpack/webpack-cli/commit/6be0478))
* Update schema-utils to the latest version 🚀 ([#565](https://github.com/webpack/webpack-cli/pull/565))
* update pkg.lock ([76c8277](https://github.com/webpack/webpack-cli/commit/76c8277))
* remove editorconfig from testfixtures ([#560](https://github.com/webpack/webpack-cli/pull/560))
* lint: fix tslint warnings ([cf0bf4a](https://github.com/webpack/webpack-cli/commit/cf0bf4a))
* lint: turn off console log warning ([db5f570](https://github.com/webpack/webpack-cli/commit/db5f570))
* lint: remove or replace console.log with console.error ([e425642](https://github.com/webpack/webpack-cli/commit/e425642))
* package: update lerna to version 3.0.0 ([08c424d](https://github.com/webpack/webpack-cli/commit/08c424d))
* scripts: update ts watch ([336ad3e](https://github.com/webpack/webpack-cli/commit/336ad3e))
* tests: added first ts test for info package ([#584](https://github.com/webpack/webpack-cli/pull/584))
## CLI
* allow array value for --ouput-library ([#559](https://github.com/webpack/webpack-cli/pull/559))
## Docs
* fixed latest changelog link ([#556](https://github.com/webpack/webpack-cli/pull/556))
* migrate documentaion ([#554](https://github.com/webpack/webpack-cli/pull/554))
* init documentaion ([#547](https://github.com/webpack/webpack-cli/pull/547))
* contribution: fix the setup workflow #591 ([#597](https://github.com/webpack/webpack-cli/pull/597))
* typedoc: add ts docs ([#571](https://github.com/webpack/webpack-cli/pull/571))
## Fix
* generate-loader: include example template in npm package ([d26ea82](https://github.com/webpack/webpack-cli/commit/d26ea82))
* generate-plugin: include example template in npm package ([77fa723](https://github.com/webpack/webpack-cli/commit/77fa723))
* package: update import-local to version 2.0.0 🚀 ([#576](https://github.com/webpack/webpack-cli/pull/576))
* prettier: add parser, filePath ([#553](https://github.com/webpack/webpack-cli/pull/553))
* schema: resolve references in schema ([#605](https://github.com/webpack/webpack-cli/pull/605))
## Misc
* Revert "cli: allow array value for --ouput-library (#559)" ([#561](https://github.com/webpack/webpack-cli/pull/561))
<a name="3.1.0"></a>
# 3.1.0 (2018-07-18)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v3.0.8...v.3.1.0)
## New Features
* generators: add typescript support ([c1844f8](https://github.com/webpack/webpack-cli/commit/c1844f8))
* init: add typescript support ([222ccdc](https://github.com/webpack/webpack-cli/commit/222ccdc))
* make: add typescript support ([4b574d9](https://github.com/webpack/webpack-cli/commit/4b574d9))
* remove: add typescript support ([f1623ed](https://github.com/webpack/webpack-cli/commit/f1623ed))
* scaffold: add typescript support ([eaf6fdf](https://github.com/webpack/webpack-cli/commit/eaf6fdf))
* scaffold: add typescript support ([f611c27](https://github.com/webpack/webpack-cli/commit/f611c27))
* serve: add typescript support ([d313421](https://github.com/webpack/webpack-cli/commit/d313421))
* types: add webpack types schema ([90909e4](https://github.com/webpack/webpack-cli/commit/90909e4))
* typescript: setup base infra ([fe25465](https://github.com/webpack/webpack-cli/commit/fe25465))
* typescript: setup base infra ([373a304](https://github.com/webpack/webpack-cli/commit/373a304))
* update: add typescript support ([53505b9](https://github.com/webpack/webpack-cli/commit/53505b9))
* utils: add typescript support ([47702cb](https://github.com/webpack/webpack-cli/commit/47702cb))
## Ast
* parser: remove ([7f51c27](https://github.com/webpack/webpack-cli/commit/7f51c27))
* parser: remove ([faeec57](https://github.com/webpack/webpack-cli/commit/faeec57))
## Chore
* add-cmd: add typescript support ([fb98933](https://github.com/webpack/webpack-cli/commit/fb98933))
* add-cmd: add typescript support ([d730841](https://github.com/webpack/webpack-cli/commit/d730841))
* build: fix eslint pattern ([#529](https://github.com/webpack/webpack-cli/pull/529))
* build: fix ci ([#535](https://github.com/webpack/webpack-cli/pull/535))
* ci: fix build ([#534](https://github.com/webpack/webpack-cli/pull/534))
* ci: fix build ([#534](https://github.com/webpack/webpack-cli/pull/534))
* ci: remove semantic release ([#516](https://github.com/webpack/webpack-cli/pull/516))
* ci: update appveyor config, script ([f220c9e](https://github.com/webpack/webpack-cli/commit/f220c9e))
* ci: update travis script ([00df5ba](https://github.com/webpack/webpack-cli/commit/00df5ba))
* update pkg.lock ([817f99c](https://github.com/webpack/webpack-cli/commit/817f99c))
* fix minor build infra ([87dd419](https://github.com/webpack/webpack-cli/commit/87dd419))
* Update eslint to the latest version 🚀 ([#526](https://github.com/webpack/webpack-cli/pull/526))
* update gitignore ([fdc82b9](https://github.com/webpack/webpack-cli/commit/fdc82b9))
* add missing READMES to packages ([#545](https://github.com/webpack/webpack-cli/pull/545))
* docs: Updated working link for webpack addon. ([#543](https://github.com/webpack/webpack-cli/pull/543))
* generate-loader,plugin: add typescript support ([971b31a](https://github.com/webpack/webpack-cli/commit/971b31a))
* info: add typescript support ([ca133ab](https://github.com/webpack/webpack-cli/commit/ca133ab))
* info: add typescript support ([2c69df0](https://github.com/webpack/webpack-cli/commit/2c69df0))
* migrate: add typescript support ([82a7dec](https://github.com/webpack/webpack-cli/commit/82a7dec))
* package: update eslint-plugin-node to version 7.0.0 ([507a4a6](https://github.com/webpack/webpack-cli/commit/507a4a6))
* package: update lockfile ([a3d41fb](https://github.com/webpack/webpack-cli/commit/a3d41fb))
* release: whitelist/blacklist release files ([#514](https://github.com/webpack/webpack-cli/pull/514))
* release: whitelist/blacklist release files ([#514](https://github.com/webpack/webpack-cli/pull/514))
* release: whitelist/blacklist release files ([#514](https://github.com/webpack/webpack-cli/pull/514))
* scripts: fix pretest ([55efce6](https://github.com/webpack/webpack-cli/commit/55efce6))
* scripts: remove semantic-release ([#525](https://github.com/webpack/webpack-cli/pull/525))
* template: tiny fix for bug template ([51dc005](https://github.com/webpack/webpack-cli/commit/51dc005))
## Docs
* update jsdoc ([#507](https://github.com/webpack/webpack-cli/pull/507))
* update jsdoc ([#507](https://github.com/webpack/webpack-cli/pull/507))
* update jsdoc ([#507](https://github.com/webpack/webpack-cli/pull/507))
* pkg: readme file for add package ([#498](https://github.com/webpack/webpack-cli/pull/498))
* pkg: readme info ([#497](https://github.com/webpack/webpack-cli/pull/497))
* pkg: readme info ([#497](https://github.com/webpack/webpack-cli/pull/497))
## Fix
* default named import bug ([ce956c0](https://github.com/webpack/webpack-cli/commit/ce956c0))
* generators: named export ([8adbe9e](https://github.com/webpack/webpack-cli/commit/8adbe9e))
## Tests
* fix: bin test outputs ([#552](https://github.com/webpack/webpack-cli/pull/552))
* migrate: fix transforms order issue ([938e5f9](https://github.com/webpack/webpack-cli/commit/938e5f9))
## Misc
* Update yargs to the latest version 🚀 ([#533](https://github.com/webpack/webpack-cli/pull/533))
<a name="0.0.8-development"></a>
# 0.0.8-development (2018-06-15, webpack CLI v.3)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.1.5...v0.0.8-development)
## Ast
* parser: add ([#456](https://github.com/webpack/webpack-cli/pull/456))
## Chore
* deps: add lerna ([a7d8085](https://github.com/webpack/webpack-cli/commit/a7d8085))
* lockfile: update pkglock ([0b024bf](https://github.com/webpack/webpack-cli/commit/0b024bf))
* monorepo: fix windows build ([0310fd3](https://github.com/webpack/webpack-cli/commit/0310fd3))
* monorepo: add bootstrap to run ([17c2c88](https://github.com/webpack/webpack-cli/commit/17c2c88))
* monorepo: fix windows build ([8c58d24](https://github.com/webpack/webpack-cli/commit/8c58d24))
* monorepo: add rimraf globally ([7c0e245](https://github.com/webpack/webpack-cli/commit/7c0e245))
* monorepo: fix versions and use clean bootstrap ([7de58ea](https://github.com/webpack/webpack-cli/commit/7de58ea))
* monorepo: fix appveyor build ([206749b](https://github.com/webpack/webpack-cli/commit/206749b))
* monorepo: add eslint-plugin-prettier ([ae55183](https://github.com/webpack/webpack-cli/commit/ae55183))
* monorepo: fix appveyor build ([a08b899](https://github.com/webpack/webpack-cli/commit/a08b899))
* monorepo: fix appveyor build ([42468d3](https://github.com/webpack/webpack-cli/commit/42468d3))
* next: dev version bump ([78b48a6](https://github.com/webpack/webpack-cli/commit/78b48a6))
* pkg: v.6 on next ([3a82b7d](https://github.com/webpack/webpack-cli/commit/3a82b7d))
* semantic: configure plugins ([#475](https://github.com/webpack/webpack-cli/pull/475))
* v.6: update init ([ebe5c6b](https://github.com/webpack/webpack-cli/commit/ebe5c6b))
## CLI
* add: re-add add command ([bf78411](https://github.com/webpack/webpack-cli/commit/bf78411))
* color: don't use color on non-tty ([#452](https://github.com/webpack/webpack-cli/pull/452))
* init: Better defaults ([#451](https://github.com/webpack/webpack-cli/pull/451))
* symlinks: Fix paths ([#453](https://github.com/webpack/webpack-cli/pull/453))
## Fix
* cli: show help flag when defaults fail ([#466](https://github.com/webpack/webpack-cli/pull/466))
* vulnerabilities: vulnerabilities patch for v3 ([#460](https://github.com/webpack/webpack-cli/pull/460))
## Tests
* cov: use regular nyc on tests ([3aa96ce](https://github.com/webpack/webpack-cli/commit/3aa96ce))
* coverage: fix coverage ([#473](https://github.com/webpack/webpack-cli/pull/473))
* no-options: refactor tests ([7be10d8](https://github.com/webpack/webpack-cli/commit/7be10d8))
* parser: fix recursive-tests signature ([#470](https://github.com/webpack/webpack-cli/pull/470))
## Misc
* Added yarn lock file to gitignore ([#455](https://github.com/webpack/webpack-cli/pull/455))
<a name="0.0.6"></a>
# 0.0.6 (2018-05-17)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.0.5...v0.0.6)
## CLI
* path: resolve better ([7fca948](https://github.com/webpack/webpack-cli/commit/7fca948))
## Misc
* v0.0.6 ([f544578](https://github.com/webpack/webpack-cli/commit/f544578))
<a name="0.0.5"></a>
# 0.0.5 (2018-05-17)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.0.4...v0.0.5)
## Chore
* deps: update deps ([58a437d](https://github.com/webpack/webpack-cli/commit/58a437d))
* prompt: revise prompt cmd ([bccc56e](https://github.com/webpack/webpack-cli/commit/bccc56e))
## Misc
* v0.0.5 ([062fa28](https://github.com/webpack/webpack-cli/commit/062fa28))
<a name="0.0.4"></a>
# 0.0.4 (2018-05-17)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.0.3...v0.0.4)
## Chore
* v: back to v1 ([3ed29c6](https://github.com/webpack/webpack-cli/commit/3ed29c6))
## Misc
* v0.0.4 ([e29a173](https://github.com/webpack/webpack-cli/commit/e29a173))
* v0.0.3 ([01cef3f](https://github.com/webpack/webpack-cli/commit/01cef3f))
* v0.0.2 ([6489b10](https://github.com/webpack/webpack-cli/commit/6489b10))
<a name="0.0.3"></a>
# 0.0.3 (2018-05-17)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.0.2...v0.0.3)
## Misc
* v0.0.3 ([b51e66d](https://github.com/webpack/webpack-cli/commit/b51e66d))
<a name="0.0.2"></a>
# 0.0.2 (2018-05-17)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v0.0.1...v0.0.2)
## Chore
* v: revise some deps ([c36f3e8](https://github.com/webpack/webpack-cli/commit/c36f3e8))
## Misc
* v0.0.2 ([91be3fd](https://github.com/webpack/webpack-cli/commit/91be3fd))
<a name="0.0.1"></a>
# 0.0.1 (2018-05-17)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.1.3...v0.0.1)
## Chore
* cli: move to lerna and scoped packages ([#434](https://github.com/webpack/webpack-cli/pull/434))
* linting: resolve linting ([80c9e9a](https://github.com/webpack/webpack-cli/commit/80c9e9a))
* linting: resolve linting ([8f6f1db](https://github.com/webpack/webpack-cli/commit/8f6f1db))
* linting: fix linting errors ([a76c46f](https://github.com/webpack/webpack-cli/commit/a76c46f))
* linting: resolve linter errors ([1db677e](https://github.com/webpack/webpack-cli/commit/1db677e))
* monorepo: fix plugin package.json ([3c822cf](https://github.com/webpack/webpack-cli/commit/3c822cf))
* monorepo: prune files and update eslint rules ([059d6f9](https://github.com/webpack/webpack-cli/commit/059d6f9))
* monorepo: move to lerna ([ec6cc38](https://github.com/webpack/webpack-cli/commit/ec6cc38))
* monorepo: use commands as normal instead of package ([bdafce0](https://github.com/webpack/webpack-cli/commit/bdafce0))
* monorepo: fix the no-missing-require error ([8ef1804](https://github.com/webpack/webpack-cli/commit/8ef1804))
* monorepo: updated package.json ([ff6c371](https://github.com/webpack/webpack-cli/commit/ff6c371))
* monorepo: merge package lock json ([d4c7c5d](https://github.com/webpack/webpack-cli/commit/d4c7c5d))
* monorepo: prune package json ([64cfef7](https://github.com/webpack/webpack-cli/commit/64cfef7))
* monorepo: fix typo ([a6a2715](https://github.com/webpack/webpack-cli/commit/a6a2715))
* monorepo: fix typo ([a1d5406](https://github.com/webpack/webpack-cli/commit/a1d5406))
* rebase: refactor stuff ([b02070d](https://github.com/webpack/webpack-cli/commit/b02070d))
* scaffold: move addons to scaffold ([b2a7470](https://github.com/webpack/webpack-cli/commit/b2a7470))
* scaffold: fix linting errors ([df8287d](https://github.com/webpack/webpack-cli/commit/df8287d))
* v: revise pkg ([ab38a3a](https://github.com/webpack/webpack-cli/commit/ab38a3a))
## CLI
* pkgs: re-add entries ([b2c2bbd](https://github.com/webpack/webpack-cli/commit/b2c2bbd))
* prompt: wip ([5f357c9](https://github.com/webpack/webpack-cli/commit/5f357c9))
* prompt: initial comment for prompt file ([f8a71c0](https://github.com/webpack/webpack-cli/commit/f8a71c0))
## Fix
* monorepo: fix versions in pacakges ([2b3035c](https://github.com/webpack/webpack-cli/commit/2b3035c))
* monorepo: update lock files ([ca8f5c1](https://github.com/webpack/webpack-cli/commit/ca8f5c1))
* monorepo: fix cross spawn versions ([0fcc5b3](https://github.com/webpack/webpack-cli/commit/0fcc5b3))
* monorepo: fix lint errors ([74fb759](https://github.com/webpack/webpack-cli/commit/74fb759))
* revert: packagejson ([3dd244b](https://github.com/webpack/webpack-cli/commit/3dd244b))
## Misc
* v0.0.1 ([faae7aa](https://github.com/webpack/webpack-cli/commit/faae7aa))
<a name="2.1.3"></a>
# 2.1.3 (2018-05-06)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.1.2...v2.1.3)
## Chore
* pkg: remove prefer global ([4149c53](https://github.com/webpack/webpack-cli/commit/4149c53))
* templates: Update issue templates ([#432](https://github.com/webpack/webpack-cli/pull/432))
## CLI
* cmds: revise yargs command ([#422](https://github.com/webpack/webpack-cli/pull/422))
<a name="2.0.14"></a>
# 2.0.14 (2018-04-05)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/2.0.13...2.0.14)
## New Features
* use npm ci for tests (#367) ([#368](https://github.com/webpack/webpack-cli/pull/368))
* add envinfo as `webpack-cli info` command ([51ab19f](https://github.com/webpack/webpack-cli/commit/51ab19f))
* --entry should override config.entry (#155) ([#358](https://github.com/webpack/webpack-cli/pull/358))
## Chore
* coverage: added reporters inside package.json ([c7d80fb](https://github.com/webpack/webpack-cli/commit/c7d80fb))
* upgrade: webpack 4.2 and other dependencies ([#362](https://github.com/webpack/webpack-cli/pull/362))
* version: v.2.0.13 ([2222f1d](https://github.com/webpack/webpack-cli/commit/2222f1d))
## CLI
* refactor: improve folder structure ([#371](https://github.com/webpack/webpack-cli/pull/371))
## Fix
* loader,plugin: fix generators path bug ([b4bfafb](https://github.com/webpack/webpack-cli/commit/b4bfafb))
<a name="2.0.13"></a>
# 2.0.13 (2018-03-22)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/2.0.12...2.0.13)
## Chore
* pkg: explicitly include files for release ([#349](https://github.com/webpack/webpack-cli/pull/349))
## CLI
* init: add webpack-cli dep ([#347](https://github.com/webpack/webpack-cli/pull/347))
<a name="2.0.12"></a>
# 2.0.12 (2018-03-14)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.0.11...v2.0.12)
## New Features
* support --build-delimiter for opt-in output delimiter (#192) ([#340](https://github.com/webpack/webpack-cli/pull/340))
## Chore
* gitignore: add vim swap files to gitignore ([3448fb5](https://github.com/webpack/webpack-cli/commit/3448fb5))
* scaffolding: update docs ([#336](https://github.com/webpack/webpack-cli/pull/336))
## Fix
* removes debug in migrate ([#342](https://github.com/webpack/webpack-cli/pull/342))
## Tests
* snapshot: update snapshot ([bd8ccda](https://github.com/webpack/webpack-cli/commit/bd8ccda))
## Misc
* cz: fix type description ([#339](https://github.com/webpack/webpack-cli/pull/339))
* init: fix global-modules require statement in package-manager ([610aa02](https://github.com/webpack/webpack-cli/commit/610aa02))
* init-generator: cleanup ([b8c3145](https://github.com/webpack/webpack-cli/commit/b8c3145))
<a name="2.0.11"></a>
# 2.0.11 (2018-03-10)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.0.10...v2.0.11)
## Chore
* bundlesize: change threshold ([2aedfda](https://github.com/webpack/webpack-cli/commit/2aedfda))
* deps: upgrade deps ([#319](https://github.com/webpack/webpack-cli/pull/319))
* docs: update docs ([3307e3b](https://github.com/webpack/webpack-cli/commit/3307e3b))
* es6: changed 'var' into 'const' where convenient ([#325](https://github.com/webpack/webpack-cli/pull/325))
* test: updated tests file names ([#324](https://github.com/webpack/webpack-cli/pull/324))
## CLI
* init: Refactor Yeoman ([#323](https://github.com/webpack/webpack-cli/pull/323))
* tapable: Remove Tapable#apply calls ([#305](https://github.com/webpack/webpack-cli/pull/305))
## Docs
* update README to remove inconsistent CLI messaging (#327) ([#328](https://github.com/webpack/webpack-cli/pull/328))
## Fix
* migrate: move options to use ([#308](https://github.com/webpack/webpack-cli/pull/308))
* adding 'fix' to whitelist ([10a00df](https://github.com/webpack/webpack-cli/commit/10a00df))
## Misc
* deps: clean up dependencies ([7078282](https://github.com/webpack/webpack-cli/commit/7078282))
* generator: Allow local paths to generators ([#265](https://github.com/webpack/webpack-cli/pull/265))
* grammar: revise spelling and incorrect syntax ([#293](https://github.com/webpack/webpack-cli/pull/293))
* readme: add npm badge ([#303](https://github.com/webpack/webpack-cli/pull/303))
<a name="2.0.10"></a>
# 2.0.10 (2018-03-02)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.0.4...v2.0.10)
## New Features
* show help when no options given ([a7ee15a](https://github.com/webpack/webpack-cli/commit/a7ee15a))
* chore: add project tools and utilities ([#270](https://github.com/webpack/webpack-cli/pull/270))
## Ast
* init: fix init command ([d36cd4f](https://github.com/webpack/webpack-cli/commit/d36cd4f))
## Chore
* .gitignore: ignore .vscode ([a322505](https://github.com/webpack/webpack-cli/commit/a322505))
* .gitignore: ignore .vscode ([ab0eacc](https://github.com/webpack/webpack-cli/commit/ab0eacc))
* add: temp remove add from cli ([f663215](https://github.com/webpack/webpack-cli/commit/f663215))
* changelog: v.2.0.7 changelog ([a165269](https://github.com/webpack/webpack-cli/commit/a165269))
* clean: remove unused dependency ([4a395d7](https://github.com/webpack/webpack-cli/commit/4a395d7))
* deps: bump uglify dep and cli version ([81a9f1e](https://github.com/webpack/webpack-cli/commit/81a9f1e))
* packager: remove yarn ([#302](https://github.com/webpack/webpack-cli/pull/302))
* pkg.json: remove commitmsg cmd ([4dff074](https://github.com/webpack/webpack-cli/commit/4dff074))
* refactor: update supports-color usage ([4566fde](https://github.com/webpack/webpack-cli/commit/4566fde))
* refactor: update supports-color usage ([97b2df3](https://github.com/webpack/webpack-cli/commit/97b2df3))
* revert: revert yargs to 9.0.1 ([7ef13ef](https://github.com/webpack/webpack-cli/commit/7ef13ef))
* upgrade: update all dependencies, devDependencies ([4bf64bf](https://github.com/webpack/webpack-cli/commit/4bf64bf))
* version: v.2.0.9 ([4cf5e17](https://github.com/webpack/webpack-cli/commit/4cf5e17))
## CLI
* devServer: change devServer path ([c27e961](https://github.com/webpack/webpack-cli/commit/c27e961))
* version: v.2.0.8 ([9406912](https://github.com/webpack/webpack-cli/commit/9406912))
## Fix
* generator: use yeoman clone ([0b4269c](https://github.com/webpack/webpack-cli/commit/0b4269c))
* yeoman-generator fork issue ([#294](https://github.com/webpack/webpack-cli/pull/294))
* Resolve webpack dependencies ([#251](https://github.com/webpack/webpack-cli/pull/251))
* change help logic ([d67f4b7](https://github.com/webpack/webpack-cli/commit/d67f4b7))
## Improvement
* add an option to watch messaging. Add .idea to .gitignore ([#200](https://github.com/webpack/webpack-cli/pull/200))
## Refactor
* convert-args: remove unused arguments ([#253](https://github.com/webpack/webpack-cli/pull/253))
## Style
* run formatter ([7be0da7](https://github.com/webpack/webpack-cli/commit/7be0da7))
## Tests
* add test for showing help on no options ([cf43939](https://github.com/webpack/webpack-cli/commit/cf43939))
* mode: add mode tests ([#285](https://github.com/webpack/webpack-cli/pull/285))
* update: migrate snapshot ([3c4e6f7](https://github.com/webpack/webpack-cli/commit/3c4e6f7))
* update: migrate snapshot ([c322067](https://github.com/webpack/webpack-cli/commit/c322067))
## Misc
* refactor: reduce code duplication use process.exitCode instead of process.exit ([#272](https://github.com/webpack/webpack-cli/pull/272))
* [feature] configuration validation ([#240](https://github.com/webpack/webpack-cli/pull/240))
* Commitlint ([#300](https://github.com/webpack/webpack-cli/pull/300))
* Change from git:// to https:// ([#259](https://github.com/webpack/webpack-cli/pull/259))
* Add jsdoc comments for migrate ([#255](https://github.com/webpack/webpack-cli/pull/255))
* strict Promise configuration validation ([#298](https://github.com/webpack/webpack-cli/pull/298))
* Refactor bin directory ([#263](https://github.com/webpack/webpack-cli/pull/263))
* Issue 249 fixed and other enums refactored ([#264](https://github.com/webpack/webpack-cli/pull/264))
* remove yargs major update due security compromise ([9bd7ed4](https://github.com/webpack/webpack-cli/commit/9bd7ed4))
* Revert "Show help on no command" ([#276](https://github.com/webpack/webpack-cli/pull/276))
* 2.0.5 ([94ac6db](https://github.com/webpack/webpack-cli/commit/94ac6db))
* v.2.0.6 ([4333088](https://github.com/webpack/webpack-cli/commit/4333088))
* fix typo.. ([0f1cee6](https://github.com/webpack/webpack-cli/commit/0f1cee6))
* binTestCases: remove obsolete snapshot ([42301d7](https://github.com/webpack/webpack-cli/commit/42301d7))
* dep: add webpack 4 as peer dependency ([#297](https://github.com/webpack/webpack-cli/pull/297))
* migrate: prettify output ([#281](https://github.com/webpack/webpack-cli/pull/281))
* revert: revert supports-color usage ([f8e819a](https://github.com/webpack/webpack-cli/commit/f8e819a))
* revert: revert supports-color usage ([75f706b](https://github.com/webpack/webpack-cli/commit/75f706b))
* syntax: prettify ([5cb146f](https://github.com/webpack/webpack-cli/commit/5cb146f))
* yargs: add description for module-bind-* args ([#286](https://github.com/webpack/webpack-cli/pull/286))
<a name="2.0.9"></a>
# 2.0.9 (2018-02-25)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.0.4...v2.0.9)
## Ast
* init: fix init command ([d36cd4f](https://github.com/webpack/webpack-cli/commit/d36cd4f))
## Chore
* .gitignore: ignore .vscode ([ab0eacc](https://github.com/webpack/webpack-cli/commit/ab0eacc))
* .gitignore: ignore .vscode ([a322505](https://github.com/webpack/webpack-cli/commit/a322505))
* add: temp remove add from cli ([f663215](https://github.com/webpack/webpack-cli/commit/f663215))
* changelog: v.2.0.7 changelog ([a165269](https://github.com/webpack/webpack-cli/commit/a165269))
* deps: bump uglify dep and cli version ([81a9f1e](https://github.com/webpack/webpack-cli/commit/81a9f1e))
* pkg.json: remove commitmsg cmd ([4dff074](https://github.com/webpack/webpack-cli/commit/4dff074))
## CLI
* devServer: change devServer path ([c27e961](https://github.com/webpack/webpack-cli/commit/c27e961))
* version: v.2.0.8 ([9406912](https://github.com/webpack/webpack-cli/commit/9406912))
## Feat
* show help when no options given ([a7ee15a](https://github.com/webpack/webpack-cli/commit/a7ee15a))
* chore: add project tools and utilities ([#270](https://github.com/webpack/webpack-cli/pull/270))
## Fix
* Resolve webpack dependencies ([#251](https://github.com/webpack/webpack-cli/pull/251))
* change help logic ([d67f4b7](https://github.com/webpack/webpack-cli/commit/d67f4b7))
* generator: use yeoman clone ([0b4269c](https://github.com/webpack/webpack-cli/commit/0b4269c))
## Improvement
* add an option to watch messaging. Add .idea to .gitignore ([#200](https://github.com/webpack/webpack-cli/pull/200))
## Refactor
* convert-args: remove unused arguments ([#253](https://github.com/webpack/webpack-cli/pull/253))
## Style
* run formatter ([7be0da7](https://github.com/webpack/webpack-cli/commit/7be0da7))
## Tests
* add test for showing help on no options ([cf43939](https://github.com/webpack/webpack-cli/commit/cf43939))
## Misc
* remove yargs major update due security compromise ([9bd7ed4](https://github.com/webpack/webpack-cli/commit/9bd7ed4))
* Revert "Show help on no command" ([#276](https://github.com/webpack/webpack-cli/pull/276))
* v.2.0.6 ([4333088](https://github.com/webpack/webpack-cli/commit/4333088))
* fix typo.. ([0f1cee6](https://github.com/webpack/webpack-cli/commit/0f1cee6))
* 2.0.5 ([94ac6db](https://github.com/webpack/webpack-cli/commit/94ac6db))
* Change from git:// to https:// ([#259](https://github.com/webpack/webpack-cli/pull/259))
* Issue 249 fixed and other enums refactored ([#264](https://github.com/webpack/webpack-cli/pull/264))
* Refactor bin directory ([#263](https://github.com/webpack/webpack-cli/pull/263))
* Add jsdoc comments for migrate ([#255](https://github.com/webpack/webpack-cli/pull/255))
* [feature] configuration validation ([#240](https://github.com/webpack/webpack-cli/pull/240))
* refactor: reduce code duplication use process.exitCode instead of process.exit ([#272](https://github.com/webpack/webpack-cli/pull/272))
<a name="2.0.7"></a>
# 2.0.7 (2018-02-24)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.0.4...v2.0.7)
## Chore
* .gitignore: ignore .vscode ([ab0eacc](https://github.com/webpack/webpack-cli/commit/ab0eacc))
* .gitignore: ignore .vscode ([a322505](https://github.com/webpack/webpack-cli/commit/a322505))
* add: temp remove add from cli ([f663215](https://github.com/webpack/webpack-cli/commit/f663215))
* deps: bump uglify dep and cli version ([81a9f1e](https://github.com/webpack/webpack-cli/commit/81a9f1e))
## Feat
* show help when no options given ([a7ee15a](https://github.com/webpack/webpack-cli/commit/a7ee15a))
* chore: add project tools and utilities ([#270](https://github.com/webpack/webpack-cli/pull/270))
## Fix
* Resolve webpack dependencies ([#251](https://github.com/webpack/webpack-cli/pull/251))
* change help logic ([d67f4b7](https://github.com/webpack/webpack-cli/commit/d67f4b7))
## Improvement
* add an option to watch messaging. Add .idea to .gitignore ([#200](https://github.com/webpack/webpack-cli/pull/200))
## Refactor
* convert-args: remove unused arguments ([#253](https://github.com/webpack/webpack-cli/pull/253))
## Style
* run formatter ([7be0da7](https://github.com/webpack/webpack-cli/commit/7be0da7))
## Tests
* add test for showing help on no options ([cf43939](https://github.com/webpack/webpack-cli/commit/cf43939))
## Misc
* remove yargs major update due security compromise ([9bd7ed4](https://github.com/webpack/webpack-cli/commit/9bd7ed4))
* Revert "Show help on no command" ([#276](https://github.com/webpack/webpack-cli/pull/276))
* v.2.0.6 ([4333088](https://github.com/webpack/webpack-cli/commit/4333088))
* fix typo.. ([0f1cee6](https://github.com/webpack/webpack-cli/commit/0f1cee6))
* 2.0.5 ([94ac6db](https://github.com/webpack/webpack-cli/commit/94ac6db))
* Change from git:// to https:// ([#259](https://github.com/webpack/webpack-cli/pull/259))
* Issue 249 fixed and other enums refactored ([#264](https://github.com/webpack/webpack-cli/pull/264))
* Refactor bin directory ([#263](https://github.com/webpack/webpack-cli/pull/263))
* Add jsdoc comments for migrate ([#255](https://github.com/webpack/webpack-cli/pull/255))
* [feature] configuration validation ([#240](https://github.com/webpack/webpack-cli/pull/240))
* refactor: reduce code duplication use process.exitCode instead of process.exit ([#272](https://github.com/webpack/webpack-cli/pull/272))
<a name="2.0.6"></a>
# 2.0.6 (2018-02-20)
[Full Changelog](https://github.com/webpack/webpack-cli/compare/v2.0.4...v2.0.6)
## Chore
* .gitignore: ignore .vscode ([ab0eacc](https://github.com/webpack/webpack-cli/commit/ab0eacc))
* .gitignore: ignore .vscode ([a322505](https://github.com/webpack/webpack-cli/commit/a322505))
* add new items to chore: adds chore command ([db243b6](https://github.com/webpack/webpack-cli/commit/db243b6))
* linting: lint added files ([6dc12af](https://github.com/webpack/webpack-cli/commit/6dc12af))
* remove cmd: removes f command ([7adfdcf](https://github.com/webpack/webpack-cli/commit/7adfdcf))
## Feat
* show help when no options given ([a7ee15a](https://github.com/webpack/webpack-cli/commit/a7ee15a))
## Fix
* Resolve webpack dependencies ([#251](https://github.com/webpack/webpack-cli/pull/251))
* change help logic ([d67f4b7](https://github.com/webpack/webpack-cli/commit/d67f4b7))
## Improvement
* add an option to watch messaging. Add .idea to .gitignore ([#200](https://github.com/webpack/webpack-cli/pull/200))
## Refactor
* convert-args: remove unused arguments ([#253](https://github.com/webpack/webpack-cli/pull/253))
## Style
* run formatter ([7be0da7](https://github.com/webpack/webpack-cli/commit/7be0da7))
## Tests
* add test for showing help on no options ([cf43939](https://github.com/webpack/webpack-cli/commit/cf43939))
## Misc
* remove yargs major update due security compromise ([9bd7ed4](https://github.com/webpack/webpack-cli/commit/9bd7ed4))
* [feature] configuration validation ([#240](https://github.com/webpack/webpack-cli/pull/240))
* v.2.0.6 ([4333088](https://github.com/webpack/webpack-cli/commit/4333088))
* fix typo.. ([0f1cee6](https://github.com/webpack/webpack-cli/commit/0f1cee6))
* 2.0.5 ([94ac6db](https://github.com/webpack/webpack-cli/commit/94ac6db))
* Change from git:// to https:// ([#259](https://github.com/webpack/webpack-cli/pull/259))
* Issue 249 fixed and other enums refactored ([#264](https://github.com/webpack/webpack-cli/pull/264))
* Refactor bin directory ([#263](https://github.com/webpack/webpack-cli/pull/263))
* Add jsdoc comments for migrate ([#255](https://github.com/webpack/webpack-cli/pull/255))
* add commitlinting: adds commit linting to the cli ([7e4dd3d](https://github.com/webpack/webpack-cli/commit/7e4dd3d))
* add eslint ignore items: adds build folder and commit linter to ignore ([a400809](https://github.com/webpack/webpack-cli/commit/a400809))
<a name="2.0.0"></a>
## 2.0.0 (2017-12-21)
* Adds add
* Remove some mocks
* Remove validationschema and ajv dependencies
* Update Jest & Jest-cli
* Remove unused dependencies
* Creator is now init
* Using env preset ([#197](https://github.com/webpack/webpack-cli/pull/197))
* Using Yarn ([#203](https://github.com/webpack/webpack-cli/pull/203))
* Using peer dep of webpack
* Transformations is now migrate
* Init has its own generator
* Commands are refactored into a HOC and sent to a folder for each command with an helper for scaffolding aliases
* Using RawList instead of List for better usability ([82c64db](https://github.com/webpack/webpack-cli/commit/541ba62f02c4a1fcc807eac62a551fcae3f2d2c3))
* lib/transformations/util is now in lib/utils/ast-utils
* Each AST module now has an extra argument that specifies action to be done
* FindPluginsByRoot is now FindRootByName and more generalistic
* Added ast util function createEmptyCallableFunctionWithArguments
* Refactor for readability ([#214](https://github.com/webpack/webpack-cli/pull/214))
* Remove dist from repo ([#215](https://github.com/webpack/webpack-cli/pull/215))
* Remove entry and output validation ([#217](https://github.com/webpack/webpack-cli/pull/217))
* topScope now checks if the import already is present
* Updated test errors/issue-5576, remember to sync with webpack/next
* User friendly startup message ([#218](https://github.com/webpack/webpack-cli/pull/218))
* Migrate now uses prettier ([88aaaa2](https://github.com/webpack/webpack-cli/commit/972d4cd90061644aa2f4aaac33d2d80cb4a56d57)
* Added transform for mode ([972d4cd](https://github.com/webpack/webpack-cli/commit/e1f512c9bb96694dd623562dc4cef411ed004c2c)
* Remove recast fork ([fba04da](https://github.com/webpack/webpack-cli/commit/b416d9c50138ef343b8bac6e3f66fdd5b917857d))
* New transforms ([b416d9c](https://github.com/webpack/webpack-cli/commit/28680c944dca0860ca59a38910840a641b418d18))
* JSdocs are added ([47de46a](https://github.com/webpack/webpack-cli/commit/285846a4cb1f976edcdb36629cf247d8017ff956))
* Added serve alias ([#204](https://github.com/webpack/webpack-cli/pull/204))
* Migrate has new validate logic ([c4c68e8](https://github.com/webpack/webpack-cli/commit/5d4430a6a5531cd8084e5a591f7884e746e21b2f))
* webpack serve logic ([5d4430a](https://github.com/webpack/webpack-cli/commit/992bfe2b08b98aebb43c68d5e5a92320ba3e32a8))
* webpack --config-register and webpack -r is added ([1f24d19](https://github.com/webpack/webpack-cli/commit/ab9421136887b7e9e10f25a39b59fb32f07b5037))
* work on makefile generation ([d86e1ce](https://github.com/webpack/webpack-cli/commit/4f9a4f88a8bd113762a54c05b3b9fe6f459855db))
* Appveyor is added ([9b2f6f5](https://github.com/webpack/webpack-cli/commit/c5c97462d6ccfa4c02fd79206fa075815520cd88))
* Remove commit-validate from docs ([#222](https://github.com/webpack/webpack-cli/pull/222))
* Added transform ResolveLoader ([7c713ce](https://github.com/webpack/webpack-cli/commit/3c90e83fa7b8dd5fbecaee5d1b9d8f0279600096))
* Using v8-compile-cache ([7e57314](https://github.com/webpack/webpack-cli/commit/0564ceb77a995239d0be7a022b948cbd727773a4))
* Adds webpack-cli bot ([#224](https://github.com/webpack/webpack-cli/pull/224))
<a name="1.3.2"></a>
## 1.3.2 (2017-05-15)
### Bug Fixes
* add css-loader appropriately ([#141](https://github.com/webpack/webpack-cli/issues/141)) ([a71600e](https://github.com/webpack/webpack-cli/commit/a71600e))
* Deps 'webpack' and 'uglifyjs-webpack-plugin' not installed when user answers yes to 'using ES2015' ([#135](https://github.com/webpack/webpack-cli/issues/135)). ([#136](https://github.com/webpack/webpack-cli/issues/136)) ([524f035](https://github.com/webpack/webpack-cli/commit/524f035))
* Install correct (`es2015`) babel preset to match generated config ([#138](https://github.com/webpack/webpack-cli/issues/138)) ([b0af53f](https://github.com/webpack/webpack-cli/commit/b0af53f))
* use correct test function ([#129](https://github.com/webpack/webpack-cli/issues/129)) ([3464d9e](https://github.com/webpack/webpack-cli/commit/3464d9e))
<a name="1.3.1"></a>
## 1.3.1 (2017-05-02)
### Bug Fixes
* add safe traverse to loaderoptionsplugin ([#77](https://github.com/webpack/webpack-cli/issues/77)) ([4020043](https://github.com/webpack/webpack-cli/commit/4020043))
* Do not create LoaderOptionsPlugin if loaderOptions is empty ([#72](https://github.com/webpack/webpack-cli/issues/72)) ([b9d22c9](https://github.com/webpack/webpack-cli/commit/b9d22c9))
([68a2dfd](https://github.com/webpack/webpack-cli/commit/68a2dfd))
* Upgrade to Jest 19 ([#71](https://github.com/webpack/webpack-cli/issues/71)) ([fe62523](https://github.com/webpack/webpack-cli/commit/fe62523))
* Use `safeTraverse` where appropriate ([#94](https://github.com/webpack/webpack-cli/issues/94)) ([dcde2b6](https://github.com/webpack/webpack-cli/commit/dcde2b6))
([3464d9e](https://github.com/webpack/webpack-cli/commit/3464d9e))
* Use real paths from argvs instead of dummy hard-coded file ([#65](https://github.com/webpack/webpack-cli/issues/65)) ([a46edbb](https://github.com/webpack/webpack-cli/commit/a46edbb))
### Features
* Add beautifier config for JS code ([64c88ea](https://github.com/webpack/webpack-cli/commit/64c88ea))
* Add commit validation and commits template ([d0cbfc0](https://github.com/webpack/webpack-cli/commit/d0cbfc0))
* Add editorconfig settings from core webpack ([89809de](https://github.com/webpack/webpack-cli/commit/89809de))
* Add yarn settings to handle dependencies ([34579c7](https://github.com/webpack/webpack-cli/commit/34579c7))
* Adds a resolved path for output ([#80](https://github.com/webpack/webpack-cli/issues/80)) ([37a594d](https://github.com/webpack/webpack-cli/commit/37a594d))
* Introduce reserve and timestamps ([#24](https://github.com/webpack/webpack-cli/issues/24)) ([ed267b4](https://github.com/webpack/webpack-cli/commit/ed267b4))
* Webpack-CLI version 1([#105](https://github.com/webpack/webpack-cli/pull/105))
* Feature: Use listr to display progress and errors for transformations([#92](https://github.com/webpack/webpack-cli/pull/92))
* Feature: Jscodeshift Transformations for --migrate ([#40](https://github.com/webpack/webpack-cli/pull/40))
+20
View File
@@ -0,0 +1,20 @@
Copyright JS Foundation and other contributors
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.
+78
View File
@@ -0,0 +1,78 @@
<div align="center">
<a href="https://github.com/webpack/webpack-cli">
<img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
</div>
<h1 align="center">webpack CLI</h1>
<p align="center">
The official CLI of webpack
</p>
<br>
[![npm](https://img.shields.io/npm/v/webpack-cli.svg)](https://www.npmjs.com/package/webpack-cli)
[![Build Status](https://travis-ci.org/webpack/webpack-cli.svg)](https://travis-ci.org/webpack/webpack-cli)
[![Build2 Status](https://dev.azure.com/webpack/webpack/_apis/build/status/webpack.webpack-cli)](https://dev.azure.com/webpack/webpack/_build/latest?definitionId=4)
[![deps][deps]][deps-url]
[![Code Climate](https://codeclimate.com/github/webpack/webpack-cli/badges/gpa.svg)](https://codeclimate.com/github/webpack/webpack-cli)
[![chat on gitter](https://badges.gitter.im/webpack/webpack.svg)](https://gitter.im/webpack/webpack)
[![Install Size](https://packagephobia.now.sh/badge?p=webpack-cli)](https://packagephobia.now.sh/result?p=webpack-cli)
[![npm](https://img.shields.io/npm/dw/webpack-cli.svg)](https://www.npmjs.com/package/webpack-cli)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)
* [About](#about)
- [How to install](#how-to-install)
* [Getting Started](#getting-started)
* [webpack CLI Scaffolds](#webpack-cli-scaffolds)
* Commands
- [`webpack-cli init`](./packages/init/README.md#webpack-cli-init)
- [`webpack-cli add`](./packages/add/README.md#webpack-cli-add)
- [`webpack-cli info`](./packages/info/README.md#webpack-cli-info)
- [`webpack-cli migrate`](./packages/migrate/README.md#webpack-cli-migrate)
- [`webpack-cli remove`](./packages/remove/README.md#webpack-cli-remove)
- [`webpack-cli generate-plugin`](./packages/generate-plugin/README.md#webpack-cli-generate-plugin)
- [`webpack-cli generate-loader`](./packages/generate-loader/README.md#webpack-cli-generate-loader)
- [`webpack-cli serve`](./packages/serve/README.md#webpack-cli-serve)
- [`webpack-cli update`](./packages/update/README.md#webpack-cli-update)
* [webpack.config.js](https://webpack.js.org/concepts/configuration/)
* [Contributing and Internal Documentation](#contributing-and-internal-documentation)
## About
webpack CLI provides a flexible set of commands for developers to increase speed when setting up a custom webpack project. As of webpack v4, webpack is not expecting a configuration file, but often developers want to create a more custom webpack configuration based on their use-cases and needs. webpack CLI addresses these needs by providing a set of tools to improve the setup of custom webpack configuration.
### How to install
When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed!
Otherwise `npm install --save-dev webpack-cli` or `yarn add webpack-cli --dev` will install it.
### Commands
Supporting developers is an important task for webpack CLI. Thus, webpack CLI provides different commands for many common tasks. We organize webpack CLI as a [multi-package repository](https://github.com/lerna/lerna). Every command has a dedicated subfolder in the `packages` Folder.
## Getting started
When you have followed the [Getting Started](https://webpack.js.org/guides/getting-started/) guide of webpack then webpack CLI is already installed! Otherwise, you would need to install webpack CLI and the packages you want to use. If we want to use the `init` functionality to create a new `webpack.config.js` configuration file:
```sh
npm i webpack-cli @webpack-cli/init
npx webpack-cli init
```
You will answer many questions when running the `init` so webpack CLI can provide the best fitting configuration.
## webpack CLI Scaffolds
With v3 of webpack CLI, we introduced scaffolding as an integral part of the CLI. Our goal is to simplify the creation of webpack configurations for different purposes. Additionally, sharing such solutions with the community is beneficial and with webpack webpack's we want to allow this. We provide `webpack-scaffold` as a utility suite for creating these scaffolds. It contains functions that could be of use for creating an scaffold yourself.
You can read more about [Scaffolding](./SCAFFOLDING.md) or check out the example project [How do I compose a webpack-scaffold?](https://github.com/evenstensberg/webpack-scaffold-demo).
## Contributing and Internal Documentation
The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our [documentation on contributing](./.github/CONTRIBUTING.md).
[deps]: https://img.shields.io/david/webpack/webpack.svg
[deps-url]: https://david-dm.org/webpack/webpack-cli
+505
View File
@@ -0,0 +1,505 @@
#!/usr/bin/env node
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
(function() {
// wrap in IIFE to be able to use return
const importLocal = require("import-local");
// Prefer the local installation of webpack-cli
if (importLocal(__filename)) {
return;
}
require("v8-compile-cache");
const ErrorHelpers = require("./errorHelpers");
const NON_COMPILATION_ARGS = [
"init",
"migrate",
"add",
"remove",
"serve",
"generate-loader",
"generate-plugin",
"info"
];
const NON_COMPILATION_CMD = process.argv.find(arg => {
if (arg === "serve") {
global.process.argv = global.process.argv.filter(a => a !== "serve");
process.argv = global.process.argv;
}
return NON_COMPILATION_ARGS.find(a => a === arg);
});
if (NON_COMPILATION_CMD) {
return require("./prompt-command")(NON_COMPILATION_CMD, ...process.argv);
}
const yargs = require("yargs").usage(`webpack-cli ${require("../package.json").version}
Usage: webpack-cli [options]
webpack-cli [options] --entry <entry> --output <output>
webpack-cli [options] <entries...> --output <output>
webpack-cli <command> [options]
For more information, see https://webpack.js.org/api/cli/.`);
require("./config-yargs")(yargs);
const DISPLAY_GROUP = "Stats options:";
const BASIC_GROUP = "Basic options:";
yargs.options({
silent: {
type: "boolean",
describe: "Prevent output from being displayed in stdout"
},
json: {
type: "boolean",
alias: "j",
describe: "Prints the result as JSON."
},
progress: {
type: "boolean",
describe: "Print compilation progress in percentage",
group: BASIC_GROUP
},
color: {
type: "boolean",
alias: "colors",
default: function supportsColor() {
return require("supports-color").stdout;
},
group: DISPLAY_GROUP,
describe: "Force colors on the console"
},
"no-color": {
type: "boolean",
alias: "no-colors",
group: DISPLAY_GROUP,
describe: "Force no colors on the console"
},
"sort-modules-by": {
type: "string",
group: DISPLAY_GROUP,
describe: "Sorts the modules list by property in module"
},
"sort-chunks-by": {
type: "string",
group: DISPLAY_GROUP,
describe: "Sorts the chunks list by property in chunk"
},
"sort-assets-by": {
type: "string",
group: DISPLAY_GROUP,
describe: "Sorts the assets list by property in asset"
},
"hide-modules": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Hides info about modules"
},
"display-exclude": {
type: "string",
group: DISPLAY_GROUP,
describe: "Exclude modules in the output"
},
"display-modules": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display even excluded modules in the output"
},
"display-max-modules": {
type: "number",
group: DISPLAY_GROUP,
describe: "Sets the maximum number of visible modules in output"
},
"display-chunks": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display chunks in the output"
},
"display-entrypoints": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display entry points in the output"
},
"display-origins": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display origins of chunks in the output"
},
"display-cached": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display also cached modules in the output"
},
"display-cached-assets": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display also cached assets in the output"
},
"display-reasons": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display reasons about module inclusion in the output"
},
"display-depth": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display distance from entry point for each module"
},
"display-used-exports": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display information about used exports in modules (Tree Shaking)"
},
"display-provided-exports": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display information about exports provided from modules"
},
"display-optimization-bailout": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display information about why optimization bailed out for modules"
},
"display-error-details": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display details about errors"
},
display: {
type: "string",
choices: ["", "verbose", "detailed", "normal", "minimal", "errors-only", "none"],
group: DISPLAY_GROUP,
describe: "Select display preset"
},
verbose: {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Show more details"
},
"info-verbosity": {
type: "string",
default: "info",
choices: ["none", "info", "verbose"],
group: DISPLAY_GROUP,
describe: "Controls the output of lifecycle messaging e.g. Started watching files..."
},
"build-delimiter": {
type: "string",
group: DISPLAY_GROUP,
describe: "Display custom text after build output"
}
});
// yargs will terminate the process early when the user uses help or version.
// This causes large help outputs to be cut short (https://github.com/nodejs/node/wiki/API-changes-between-v0.10-and-v4#process).
// To prevent this we use the yargs.parse API and exit the process normally
yargs.parse(process.argv.slice(2), (err, argv, output) => {
Error.stackTraceLimit = 30;
// arguments validation failed
if (err && output) {
console.error(output);
process.exitCode = 1;
return;
}
// help or version info
if (output) {
console.log(output);
return;
}
if (argv.verbose) {
argv["display"] = "verbose";
}
let options;
try {
options = require("./convert-argv")(argv);
} catch (err) {
if (err.name !== "ValidationError") {
throw err;
}
const stack = ErrorHelpers.cleanUpWebpackOptions(err.stack, err.message);
const message = err.message + "\n" + stack;
if (argv.color) {
console.error(`\u001b[1m\u001b[31m${message}\u001b[39m\u001b[22m`);
} else {
console.error(message);
}
process.exitCode = 1;
return;
}
/**
* When --silent flag is present, an object with a no-op write method is
* used in place of process.stout
*/
const stdout = argv.silent
? {
write: () => {}
} // eslint-disable-line
: process.stdout;
function ifArg(name, fn, init) {
if (Array.isArray(argv[name])) {
if (init) init();
argv[name].forEach(fn);
} else if (typeof argv[name] !== "undefined") {
if (init) init();
fn(argv[name], -1);
}
}
function processOptions(options) {
// process Promise
if (typeof options.then === "function") {
options.then(processOptions).catch(function(err) {
console.error(err.stack || err);
process.exit(1); // eslint-disable-line
});
return;
}
const firstOptions = [].concat(options)[0];
const statsPresetToOptions = require("webpack").Stats.presetToOptions;
let outputOptions = options.stats;
if (typeof outputOptions === "boolean" || typeof outputOptions === "string") {
outputOptions = statsPresetToOptions(outputOptions);
} else if (!outputOptions) {
outputOptions = {};
}
ifArg("display", function(preset) {
outputOptions = statsPresetToOptions(preset);
});
outputOptions = Object.create(outputOptions);
if (Array.isArray(options) && !outputOptions.children) {
outputOptions.children = options.map(o => o.stats);
}
if (typeof outputOptions.context === "undefined") outputOptions.context = firstOptions.context;
ifArg("env", function(value) {
if (outputOptions.env) {
outputOptions._env = value;
}
});
ifArg("json", function(bool) {
if (bool) {
outputOptions.json = bool;
outputOptions.modules = bool;
}
});
if (typeof outputOptions.colors === "undefined") outputOptions.colors = require("supports-color").stdout;
ifArg("sort-modules-by", function(value) {
outputOptions.modulesSort = value;
});
ifArg("sort-chunks-by", function(value) {
outputOptions.chunksSort = value;
});
ifArg("sort-assets-by", function(value) {
outputOptions.assetsSort = value;
});
ifArg("display-exclude", function(value) {
outputOptions.exclude = value;
});
if (!outputOptions.json) {
if (typeof outputOptions.cached === "undefined") outputOptions.cached = false;
if (typeof outputOptions.cachedAssets === "undefined") outputOptions.cachedAssets = false;
ifArg("display-chunks", function(bool) {
if (bool) {
outputOptions.modules = false;
outputOptions.chunks = true;
outputOptions.chunkModules = true;
}
});
ifArg("display-entrypoints", function(bool) {
outputOptions.entrypoints = bool;
});
ifArg("display-reasons", function(bool) {
if (bool) outputOptions.reasons = true;
});
ifArg("display-depth", function(bool) {
if (bool) outputOptions.depth = true;
});
ifArg("display-used-exports", function(bool) {
if (bool) outputOptions.usedExports = true;
});
ifArg("display-provided-exports", function(bool) {
if (bool) outputOptions.providedExports = true;
});
ifArg("display-optimization-bailout", function(bool) {
if (bool) outputOptions.optimizationBailout = bool;
});
ifArg("display-error-details", function(bool) {
if (bool) outputOptions.errorDetails = true;
});
ifArg("display-origins", function(bool) {
if (bool) outputOptions.chunkOrigins = true;
});
ifArg("display-max-modules", function(value) {
outputOptions.maxModules = +value;
});
ifArg("display-cached", function(bool) {
if (bool) outputOptions.cached = true;
});
ifArg("display-cached-assets", function(bool) {
if (bool) outputOptions.cachedAssets = true;
});
if (!outputOptions.exclude) outputOptions.exclude = ["node_modules", "bower_components", "components"];
if (argv["display-modules"]) {
outputOptions.maxModules = Infinity;
outputOptions.exclude = undefined;
outputOptions.modules = true;
}
}
ifArg("hide-modules", function(bool) {
if (bool) {
outputOptions.modules = false;
outputOptions.chunkModules = false;
}
});
ifArg("info-verbosity", function(value) {
outputOptions.infoVerbosity = value;
});
ifArg("build-delimiter", function(value) {
outputOptions.buildDelimiter = value;
});
const webpack = require("webpack");
let lastHash = null;
let compiler;
try {
compiler = webpack(options);
} catch (err) {
if (err.name === "WebpackOptionsValidationError") {
if (argv.color) console.error(`\u001b[1m\u001b[31m${err.message}\u001b[39m\u001b[22m`);
else console.error(err.message);
// eslint-disable-next-line no-process-exit
process.exit(1);
}
throw err;
}
if (argv.progress) {
const ProgressPlugin = require("webpack").ProgressPlugin;
new ProgressPlugin({
profile: argv.profile
}).apply(compiler);
}
if (outputOptions.infoVerbosity === "verbose") {
if (argv.w) {
compiler.hooks.watchRun.tap("WebpackInfo", compilation => {
const compilationName = compilation.name ? compilation.name : "";
console.error("\nCompilation " + compilationName + " starting…\n");
});
} else {
compiler.hooks.beforeRun.tap("WebpackInfo", compilation => {
const compilationName = compilation.name ? compilation.name : "";
console.error("\nCompilation " + compilationName + " starting…\n");
});
}
compiler.hooks.done.tap("WebpackInfo", compilation => {
const compilationName = compilation.name ? compilation.name : "";
console.error("\nCompilation " + compilationName + " finished\n");
});
}
function compilerCallback(err, stats) {
if (!options.watch || err) {
// Do not keep cache anymore
compiler.purgeInputFileSystem();
}
if (err) {
lastHash = null;
console.error(err.stack || err);
if (err.details) console.error(err.details);
process.exit(1); // eslint-disable-line
}
if (outputOptions.json) {
stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n");
} else if (stats.hash !== lastHash) {
lastHash = stats.hash;
if (stats.compilation && stats.compilation.errors.length !== 0) {
const errors = stats.compilation.errors;
if (errors[0].name === "EntryModuleNotFoundError") {
console.error("\n\u001b[1m\u001b[31mInsufficient number of arguments or no entry found.");
console.error(
"\u001b[1m\u001b[31mAlternatively, run 'webpack(-cli) --help' for usage info.\u001b[39m\u001b[22m\n"
);
}
}
const statsString = stats.toString(outputOptions);
const delimiter = outputOptions.buildDelimiter ? `${outputOptions.buildDelimiter}\n` : "";
if (statsString) stdout.write(`${statsString}\n${delimiter}`);
}
if (!options.watch && stats.hasErrors()) {
process.exitCode = 2;
}
}
if (firstOptions.watch || options.watch) {
const watchOptions = firstOptions.watchOptions || firstOptions.watch || options.watch || {};
if (watchOptions.stdin) {
process.stdin.on("end", function(_) {
process.exit(); // eslint-disable-line
});
process.stdin.resume();
}
compiler.watch(watchOptions, compilerCallback);
if (outputOptions.infoVerbosity !== "none") console.error("\nwebpack is watching the files…\n");
} else {
compiler.run((err, stats) => {
if (compiler.close) {
compiler.close(err2 => {
compilerCallback(err || err2, stats);
});
} else {
compilerCallback(err, stats);
}
});
}
}
processOptions(options);
});
})();
+351
View File
@@ -0,0 +1,351 @@
const optionsSchema = require("./optionsSchema.json");
const nestedProperties = ["anyOf", "oneOf", "allOf"];
const resolveSchema = schema => {
let current = schema;
if (schema && typeof schema === "object" && "$ref" in schema) {
const path = schema.$ref.split("/");
for (const element of path) {
if (element === "#") {
current = optionsSchema;
} else {
current = current[element];
}
}
}
return current;
};
const findPropertyInSchema = (schema, property, subProperty) => {
if (!schema) return null;
if (subProperty) {
if (schema[property] && typeof schema[property] === "object" && subProperty in schema[property]) {
return resolveSchema(schema[property][subProperty]);
}
} else {
if (property in schema) return resolveSchema(schema[property]);
}
for (const name of nestedProperties) {
if (schema[name]) {
for (const item of schema[name]) {
const resolvedItem = resolveSchema(item);
const result = findPropertyInSchema(resolvedItem, property, subProperty);
if (result) return result;
}
}
}
return undefined;
};
const getSchemaInfo = (path, property, subProperty) => {
const pathSegments = path.split(".");
let current = optionsSchema;
for (const segment of pathSegments) {
if (segment === "*") {
current = findPropertyInSchema(current, "additionalProperties") || findPropertyInSchema(current, "items");
} else {
current = findPropertyInSchema(current, "properties", segment);
}
if (!current) return undefined;
}
return findPropertyInSchema(current, property, subProperty);
};
const CONFIG_GROUP = "Config options:";
const BASIC_GROUP = "Basic options:";
const MODULE_GROUP = "Module options:";
const OUTPUT_GROUP = "Output options:";
const ADVANCED_GROUP = "Advanced options:";
const RESOLVE_GROUP = "Resolving options:";
const OPTIMIZE_GROUP = "Optimizing options:";
module.exports = function(yargs) {
yargs
.help("help")
.alias("help", "h")
.version()
.alias("version", "v")
.options({
config: {
type: "string",
describe: "Path to the config file",
group: CONFIG_GROUP,
defaultDescription: "webpack.config.js or webpackfile.js",
requiresArg: true
},
"config-register": {
type: "array",
alias: "r",
describe: "Preload one or more modules before loading the webpack configuration",
group: CONFIG_GROUP,
defaultDescription: "module id or path",
requiresArg: true
},
"config-name": {
type: "string",
describe: "Name of the config to use",
group: CONFIG_GROUP,
requiresArg: true
},
env: {
describe: "Environment passed to the config, when it is a function",
group: CONFIG_GROUP
},
mode: {
type: getSchemaInfo("mode", "type"),
choices: getSchemaInfo("mode", "enum"),
describe: getSchemaInfo("mode", "description"),
group: CONFIG_GROUP,
requiresArg: true
},
context: {
type: getSchemaInfo("context", "type"),
describe: getSchemaInfo("context", "description"),
group: BASIC_GROUP,
defaultDescription: "The current directory",
requiresArg: true
},
entry: {
type: "string",
describe: getSchemaInfo("entry", "description"),
group: BASIC_GROUP,
requiresArg: true
},
"module-bind": {
type: "string",
describe: "Bind an extension to a loader",
group: MODULE_GROUP,
requiresArg: true
},
"module-bind-post": {
type: "string",
describe: "Bind an extension to a post loader",
group: MODULE_GROUP,
requiresArg: true
},
"module-bind-pre": {
type: "string",
describe: "Bind an extension to a pre loader",
group: MODULE_GROUP,
requiresArg: true
},
output: {
alias: "o",
describe: "The output path and file for compilation assets",
group: OUTPUT_GROUP,
requiresArg: true
},
"output-path": {
type: "string",
describe: getSchemaInfo("output.path", "description"),
group: OUTPUT_GROUP,
defaultDescription: "The current directory",
requiresArg: true
},
"output-filename": {
type: "string",
describe: getSchemaInfo("output.filename", "description"),
group: OUTPUT_GROUP,
defaultDescription: "[name].js",
requiresArg: true
},
"output-chunk-filename": {
type: "string",
describe: getSchemaInfo("output.chunkFilename", "description"),
group: OUTPUT_GROUP,
defaultDescription: "filename with [id] instead of [name] or [id] prefixed",
requiresArg: true
},
"output-source-map-filename": {
type: "string",
describe: getSchemaInfo("output.sourceMapFilename", "description"),
group: OUTPUT_GROUP,
requiresArg: true
},
"output-public-path": {
type: "string",
describe: getSchemaInfo("output.publicPath", "description"),
group: OUTPUT_GROUP,
requiresArg: true
},
"output-jsonp-function": {
type: "string",
describe: getSchemaInfo("output.jsonpFunction", "description"),
group: OUTPUT_GROUP,
requiresArg: true
},
"output-pathinfo": {
type: "boolean",
describe: getSchemaInfo("output.pathinfo", "description"),
group: OUTPUT_GROUP
},
"output-library": {
type: "array",
describe: "Expose the exports of the entry point as library",
group: OUTPUT_GROUP,
requiresArg: true
},
"output-library-target": {
type: "string",
describe: getSchemaInfo("output.libraryTarget", "description"),
choices: getSchemaInfo("output.libraryTarget", "enum"),
group: OUTPUT_GROUP,
requiresArg: true
},
"records-input-path": {
type: "string",
describe: getSchemaInfo("recordsInputPath", "description"),
group: ADVANCED_GROUP,
requiresArg: true
},
"records-output-path": {
type: "string",
describe: getSchemaInfo("recordsOutputPath", "description"),
group: ADVANCED_GROUP,
requiresArg: true
},
"records-path": {
type: "string",
describe: getSchemaInfo("recordsPath", "description"),
group: ADVANCED_GROUP,
requiresArg: true
},
define: {
type: "string",
describe: "Define any free var in the bundle",
group: ADVANCED_GROUP,
requiresArg: true
},
target: {
type: "string",
describe: getSchemaInfo("target", "description"),
group: ADVANCED_GROUP,
requiresArg: true
},
cache: {
type: "boolean",
describe: getSchemaInfo("cache", "description"),
default: null,
group: ADVANCED_GROUP,
defaultDescription: "It's enabled by default when watching"
},
watch: {
type: "boolean",
alias: "w",
describe: getSchemaInfo("watch", "description"),
group: BASIC_GROUP
},
"watch-stdin": {
type: "boolean",
alias: "stdin",
describe: getSchemaInfo("watchOptions.stdin", "description"),
group: ADVANCED_GROUP
},
"watch-aggregate-timeout": {
describe: getSchemaInfo("watchOptions.aggregateTimeout", "description"),
type: getSchemaInfo("watchOptions.aggregateTimeout", "type"),
group: ADVANCED_GROUP,
requiresArg: true
},
"watch-poll": {
type: "string",
describe: getSchemaInfo("watchOptions.poll", "description"),
group: ADVANCED_GROUP
},
hot: {
type: "boolean",
describe: "Enables Hot Module Replacement",
group: ADVANCED_GROUP
},
debug: {
type: "boolean",
describe: "Switch loaders to debug mode",
group: BASIC_GROUP
},
devtool: {
type: "string",
describe: getSchemaInfo("devtool", "description"),
group: BASIC_GROUP,
requiresArg: true
},
"resolve-alias": {
type: "string",
describe: getSchemaInfo("resolve.alias", "description"),
group: RESOLVE_GROUP,
requiresArg: true
},
"resolve-extensions": {
type: "array",
describe: getSchemaInfo("resolve.alias", "description"),
group: RESOLVE_GROUP,
requiresArg: true
},
"resolve-loader-alias": {
type: "string",
describe: "Setup a loader alias for resolving",
group: RESOLVE_GROUP,
requiresArg: true
},
"optimize-max-chunks": {
describe: "Try to keep the chunk count below a limit",
group: OPTIMIZE_GROUP,
requiresArg: true
},
"optimize-min-chunk-size": {
describe: getSchemaInfo("optimization.splitChunks.minSize", "description"),
group: OPTIMIZE_GROUP,
requiresArg: true
},
"optimize-minimize": {
type: "boolean",
describe: getSchemaInfo("optimization.minimize", "description"),
group: OPTIMIZE_GROUP
},
prefetch: {
type: "string",
describe: "Prefetch this request (Example: --prefetch ./file.js)",
group: ADVANCED_GROUP,
requiresArg: true
},
provide: {
type: "string",
describe: "Provide these modules as free vars in all modules (Example: --provide jQuery=jquery)",
group: ADVANCED_GROUP,
requiresArg: true
},
"labeled-modules": {
type: "boolean",
describe: "Enables labeled modules",
group: ADVANCED_GROUP
},
plugin: {
type: "string",
describe: "Load this plugin",
group: ADVANCED_GROUP,
requiresArg: true
},
bail: {
type: getSchemaInfo("bail", "type"),
describe: getSchemaInfo("bail", "description"),
group: ADVANCED_GROUP,
default: null
},
profile: {
type: "boolean",
describe: getSchemaInfo("profile", "description"),
group: ADVANCED_GROUP,
default: null
},
d: {
type: "boolean",
describe: "shortcut for --debug --devtool eval-cheap-module-source-map --output-pathinfo",
group: BASIC_GROUP
},
p: {
type: "boolean",
describe: "shortcut for --optimize-minimize --define process.env.NODE_ENV=\"production\"",
group: BASIC_GROUP
}
});
};
+560
View File
@@ -0,0 +1,560 @@
const path = require("path");
const fs = require("fs");
fs.existsSync = fs.existsSync || path.existsSync;
const interpret = require("interpret");
const prepareOptions = require("./prepareOptions");
const webpackConfigurationSchema = require("./webpackConfigurationSchema.json");
const validateSchema = require("webpack").validateSchema;
const WebpackOptionsValidationError = require("webpack").WebpackOptionsValidationError;
const findup = require("findup-sync");
module.exports = function(...args) {
const argv = args[1] || args[0];
const options = [];
// Shortcuts
if (argv.d) {
argv.debug = true;
argv["output-pathinfo"] = true;
if (!argv.devtool) {
argv.devtool = "eval-cheap-module-source-map";
}
if (!argv.mode) {
argv.mode = "development";
}
}
if (argv.p) {
argv["optimize-minimize"] = true;
argv["define"] = [].concat(argv["define"] || []).concat("process.env.NODE_ENV=\"production\"");
if (!argv.mode) {
argv.mode = "production";
}
}
if (argv.output) {
let output = argv.output;
if (!path.isAbsolute(argv.o)) {
output = path.resolve(process.cwd(), output);
}
argv["output-filename"] = path.basename(output);
argv["output-path"] = path.dirname(output);
}
let configFileLoaded = false;
let configFiles = [];
const extensions = Object.keys(interpret.extensions).sort(function(a, b) {
return a === ".js" ? -1 : b === ".js" ? 1 : a.length - b.length;
});
let i;
if (argv.config) {
const getConfigExtension = function getConfigExtension(configPath) {
for (i = extensions.length - 1; i >= 0; i--) {
const tmpExt = extensions[i];
if (configPath.indexOf(tmpExt, configPath.length - tmpExt.length) > -1) {
return tmpExt;
}
}
return path.extname(configPath);
};
const mapConfigArg = function mapConfigArg(configArg) {
const resolvedPath = path.resolve(configArg);
const extension = getConfigExtension(resolvedPath);
return {
path: resolvedPath,
ext: extension
};
};
const configArgList = Array.isArray(argv.config) ? argv.config : [argv.config];
configFiles = configArgList.map(mapConfigArg);
} else {
const defaultConfigFileNames = ["webpack.config", "webpackfile"].join("|");
const webpackConfigFileRegExp = `(${defaultConfigFileNames})(${extensions.join("|")})`;
const pathToWebpackConfig = findup(webpackConfigFileRegExp);
if (pathToWebpackConfig) {
const resolvedPath = path.resolve(pathToWebpackConfig);
const actualConfigFileName = path.basename(resolvedPath);
const ext = actualConfigFileName.replace(new RegExp(defaultConfigFileNames), "");
configFiles.push({
path: resolvedPath,
ext
});
}
}
if (configFiles.length > 0) {
const registerCompiler = function registerCompiler(moduleDescriptor) {
if (moduleDescriptor) {
if (typeof moduleDescriptor === "string") {
require(moduleDescriptor);
} else if (!Array.isArray(moduleDescriptor)) {
moduleDescriptor.register(require(moduleDescriptor.module));
} else {
for (let i = 0; i < moduleDescriptor.length; i++) {
try {
registerCompiler(moduleDescriptor[i]);
break;
} catch (e) {
// do nothing
}
}
}
}
};
const requireConfig = function requireConfig(configPath) {
let options = (function WEBPACK_OPTIONS() {
if (argv.configRegister && argv.configRegister.length) {
module.paths.unshift(path.resolve(process.cwd(), "node_modules"), process.cwd());
argv.configRegister.forEach(dep => {
require(dep);
});
return require(configPath);
} else {
return require(configPath);
}
})();
options = prepareOptions(options, argv);
return options;
};
configFiles.forEach(function(file) {
registerCompiler(interpret.extensions[file.ext]);
options.push(requireConfig(file.path));
});
configFileLoaded = true;
}
if (!configFileLoaded) {
return processConfiguredOptions({});
} else if (options.length === 1) {
return processConfiguredOptions(options[0]);
} else {
return processConfiguredOptions(options);
}
function processConfiguredOptions(options) {
const webpackConfigurationValidationErrors = validateSchema(webpackConfigurationSchema, options);
if (webpackConfigurationValidationErrors.length) {
const error = new WebpackOptionsValidationError(webpackConfigurationValidationErrors);
console.error(error.message, `\nReceived: ${typeof options} : ${JSON.stringify(options, null, 2)}`);
process.exit(-1); // eslint-disable-line
}
// process Promise
if (typeof options.then === "function") {
return options.then(processConfiguredOptions);
}
// process ES6 default
if (typeof options === "object" && typeof options.default === "object") {
return processConfiguredOptions(options.default);
}
// filter multi-config by name
if (Array.isArray(options) && argv["config-name"]) {
const namedOptions = options.filter(function(opt) {
return opt.name === argv["config-name"];
});
if (namedOptions.length === 0) {
console.error("Configuration with name '" + argv["config-name"] + "' was not found.");
process.exit(-1); // eslint-disable-line
} else if (namedOptions.length === 1) {
return processConfiguredOptions(namedOptions[0]);
}
options = namedOptions;
}
if (Array.isArray(options)) {
options.forEach(processOptions);
} else {
processOptions(options);
}
if (argv.context) {
options.context = path.resolve(argv.context);
}
if (!options.context) {
options.context = process.cwd();
}
if (argv.watch) {
options.watch = true;
}
if (argv["watch-aggregate-timeout"]) {
options.watchOptions = options.watchOptions || {};
options.watchOptions.aggregateTimeout = +argv["watch-aggregate-timeout"];
}
if (typeof argv["watch-poll"] !== "undefined") {
options.watchOptions = options.watchOptions || {};
if (argv["watch-poll"] === "true" || argv["watch-poll"] === "") options.watchOptions.poll = true;
else if (!isNaN(argv["watch-poll"])) options.watchOptions.poll = +argv["watch-poll"];
}
if (argv["watch-stdin"]) {
options.watchOptions = options.watchOptions || {};
options.watchOptions.stdin = true;
options.watch = true;
}
return options;
}
function processOptions(options) {
function ifArg(name, fn, init, finalize) {
const isArray = Array.isArray(argv[name]);
const isSet = typeof argv[name] !== "undefined" && argv[name] !== null;
if (!isArray && !isSet) return;
init && init();
if (isArray) argv[name].forEach(fn);
else if (isSet) fn(argv[name], -1);
finalize && finalize();
}
function ifArgPair(name, fn, init, finalize) {
ifArg(
name,
function(content, idx) {
const i = content.indexOf("=");
if (i < 0) {
return fn(null, content, idx);
} else {
return fn(content.substr(0, i), content.substr(i + 1), idx);
}
},
init,
finalize
);
}
function ifBooleanArg(name, fn) {
ifArg(name, function(bool) {
if (bool) {
fn();
}
});
}
function mapArgToBoolean(name, optionName) {
ifArg(name, function(bool) {
if (bool === true) options[optionName || name] = true;
else if (bool === false) options[optionName || name] = false;
});
}
function loadPlugin(name) {
const loadUtils = require("loader-utils");
let args;
try {
const p = name && name.indexOf("?");
if (p > -1) {
args = loadUtils.parseQuery(name.substring(p));
name = name.substring(0, p);
}
} catch (e) {
console.log("Invalid plugin arguments " + name + " (" + e + ").");
process.exit(-1); // eslint-disable-line
}
let path;
try {
const resolve = require("enhanced-resolve");
path = resolve.sync(process.cwd(), name);
} catch (e) {
console.log("Cannot resolve plugin " + name + ".");
process.exit(-1); // eslint-disable-line
}
let Plugin;
try {
Plugin = require(path);
} catch (e) {
console.log("Cannot load plugin " + name + ". (" + path + ")");
throw e;
}
try {
return new Plugin(args);
} catch (e) {
console.log("Cannot instantiate plugin " + name + ". (" + path + ")");
throw e;
}
}
function ensureObject(parent, name, force) {
if (force || typeof parent[name] !== "object" || parent[name] === null) {
parent[name] = {};
}
}
function ensureArray(parent, name) {
if (!Array.isArray(parent[name])) {
parent[name] = [];
}
}
function addPlugin(options, plugin) {
ensureArray(options, "plugins");
options.plugins.unshift(plugin);
}
ifArg("mode", function(value) {
options.mode = value;
});
ifArgPair(
"entry",
function(name, entry) {
if (typeof options.entry[name] !== "undefined" && options.entry[name] !== null) {
options.entry[name] = [].concat(options.entry[name]).concat(entry);
} else {
options.entry[name] = entry;
}
},
function() {
ensureObject(options, "entry", true);
}
);
function bindRules(arg) {
ifArgPair(
arg,
function(name, binding) {
if (name === null) {
name = binding;
binding += "-loader";
}
const rule = {
test: new RegExp("\\." + name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "$"), // eslint-disable-line no-useless-escape
loader: binding
};
if (arg === "module-bind-pre") {
rule.enforce = "pre";
} else if (arg === "module-bind-post") {
rule.enforce = "post";
}
options.module.rules.push(rule);
},
function() {
ensureObject(options, "module");
ensureArray(options.module, "rules");
}
);
}
bindRules("module-bind");
bindRules("module-bind-pre");
bindRules("module-bind-post");
let defineObject;
ifArgPair(
"define",
function(name, value) {
if (name === null) {
name = value;
value = true;
}
defineObject[name] = value;
},
function() {
defineObject = {};
},
function() {
const DefinePlugin = require("webpack").DefinePlugin;
addPlugin(options, new DefinePlugin(defineObject));
}
);
ifArg("output-path", function(value) {
ensureObject(options, "output");
options.output.path = path.resolve(value);
});
ifArg("output-filename", function(value) {
ensureObject(options, "output");
options.output.filename = value;
});
ifArg("output-chunk-filename", function(value) {
ensureObject(options, "output");
options.output.chunkFilename = value;
});
ifArg("output-source-map-filename", function(value) {
ensureObject(options, "output");
options.output.sourceMapFilename = value;
});
ifArg("output-public-path", function(value) {
ensureObject(options, "output");
options.output.publicPath = value;
});
ifArg("output-jsonp-function", function(value) {
ensureObject(options, "output");
options.output.jsonpFunction = value;
});
ifBooleanArg("output-pathinfo", function() {
ensureObject(options, "output");
options.output.pathinfo = true;
});
ifArg("output-library", function(value) {
ensureObject(options, "output");
ensureArray(options.output, "library");
options.output.library.push(value);
});
ifArg("output-library-target", function(value) {
ensureObject(options, "output");
options.output.libraryTarget = value;
});
ifArg("records-input-path", function(value) {
options.recordsInputPath = path.resolve(value);
});
ifArg("records-output-path", function(value) {
options.recordsOutputPath = path.resolve(value);
});
ifArg("records-path", function(value) {
options.recordsPath = path.resolve(value);
});
ifArg("target", function(value) {
options.target = value;
});
mapArgToBoolean("cache");
ifBooleanArg("hot", function() {
const HotModuleReplacementPlugin = require("webpack").HotModuleReplacementPlugin;
addPlugin(options, new HotModuleReplacementPlugin());
});
ifBooleanArg("debug", function() {
const LoaderOptionsPlugin = require("webpack").LoaderOptionsPlugin;
addPlugin(
options,
new LoaderOptionsPlugin({
debug: true
})
);
});
ifArg("devtool", function(value) {
options.devtool = value;
});
function processResolveAlias(arg, key) {
ifArgPair(arg, function(name, value) {
if (!name) {
throw new Error("--" + arg + " <string>=<string>");
}
ensureObject(options, key);
ensureObject(options[key], "alias");
options[key].alias[name] = value;
});
}
processResolveAlias("resolve-alias", "resolve");
processResolveAlias("resolve-loader-alias", "resolveLoader");
ifArg("resolve-extensions", function(value) {
ensureObject(options, "resolve");
if (Array.isArray(value)) {
options.resolve.extensions = value;
} else {
options.resolve.extensions = value.split(/,\s*/);
}
});
ifArg("optimize-max-chunks", function(value) {
const LimitChunkCountPlugin = require("webpack").optimize.LimitChunkCountPlugin;
addPlugin(
options,
new LimitChunkCountPlugin({
maxChunks: parseInt(value, 10)
})
);
});
ifArg("optimize-min-chunk-size", function(value) {
const MinChunkSizePlugin = require("webpack").optimize.MinChunkSizePlugin;
addPlugin(
options,
new MinChunkSizePlugin({
minChunkSize: parseInt(value, 10)
})
);
});
ifBooleanArg("optimize-minimize", function() {
const LoaderOptionsPlugin = require("webpack").LoaderOptionsPlugin;
addPlugin(
options,
new LoaderOptionsPlugin({
minimize: true
})
);
});
ifArg("prefetch", function(request) {
const PrefetchPlugin = require("webpack").PrefetchPlugin;
addPlugin(options, new PrefetchPlugin(request));
});
ifArg("provide", function(value) {
const idx = value.indexOf("=");
let name;
if (idx >= 0) {
name = value.substr(0, idx);
value = value.substr(idx + 1);
} else {
name = value;
}
const ProvidePlugin = require("webpack").ProvidePlugin;
addPlugin(options, new ProvidePlugin(name, value));
});
ifArg("plugin", function(value) {
addPlugin(options, loadPlugin(value));
});
mapArgToBoolean("bail");
mapArgToBoolean("profile");
if (argv._.length > 0) {
ensureObject(options, "entry", true);
const addTo = function addTo(name, entry) {
if (options.entry[name]) {
if (!Array.isArray(options.entry[name])) {
options.entry[name] = [options.entry[name]];
}
options.entry[name].push(entry);
} else {
options.entry[name] = entry;
}
};
argv._.forEach(function(content) {
const i = content.indexOf("=");
const j = content.indexOf("?");
if (i < 0 || (j >= 0 && j < i)) {
const resolved = path.resolve(content);
if (fs.existsSync(resolved)) {
addTo("main", `${resolved}${fs.statSync(resolved).isDirectory() ? path.sep : ""}`);
} else {
addTo("main", content);
}
} else {
addTo(content.substr(0, i), content.substr(i + 1));
}
});
}
}
};
+33
View File
@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const webpackOptionsFlag = "WEBPACK_OPTIONS";
exports.cutOffByFlag = (stack, flag) => {
stack = stack.split("\n");
for (let i = 0; i < stack.length; i++) if (stack[i].indexOf(flag) >= 0) stack.length = i;
return stack.join("\n");
};
exports.cutOffWebpackOptions = stack => exports.cutOffByFlag(stack, webpackOptionsFlag);
exports.cutOffMultilineMessage = (stack, message) => {
stack = stack.split("\n");
message = message.split("\n");
return stack
.reduce(
(acc, line, idx) => (line === message[idx] || line === `Error: ${message[idx]}` ? acc : acc.concat(line)),
[]
)
.join("\n");
};
exports.cleanUpWebpackOptions = (stack, message) => {
stack = exports.cutOffWebpackOptions(stack);
stack = exports.cutOffMultilineMessage(stack, message);
return stack;
};
+1989
View File
File diff suppressed because it is too large Load Diff
+24
View File
@@ -0,0 +1,24 @@
"use strict";
module.exports = function prepareOptions(options, argv) {
argv = argv || {};
options = handleExport(options);
return Array.isArray(options)
? options.map(_options => handleFunction(_options, argv))
: handleFunction(options, argv);
};
function handleExport(options) {
const isES6DefaultExported =
typeof options === "object" && options !== null && typeof options.default !== "undefined";
return isES6DefaultExported ? options.default : options;
}
function handleFunction(options, argv) {
if (typeof options === "function") {
options = options(argv.env, argv);
}
return options;
}
+137
View File
@@ -0,0 +1,137 @@
// based on https://github.com/webpack/webpack/blob/master/bin/webpack.js
/**
* @param {string} command process to run
* @param {string[]} args commandline arguments
* @returns {Promise<void>} promise
*/
const runCommand = (command, args) => {
const cp = require("child_process");
return new Promise((resolve, reject) => {
const executedCommand = cp.spawn(command, args, {
stdio: "inherit",
shell: true
});
executedCommand.on("error", error => {
reject(error);
});
executedCommand.on("exit", code => {
if (code === 0) {
resolve();
} else {
reject();
}
});
});
};
const npmGlobalRoot = () => {
const cp = require("child_process");
return new Promise((resolve, reject) => {
const command = cp.spawn("npm", ["root", "-g"]);
command.on("error", (error) => reject(error));
command.stdout.on("data", (data) => resolve(data.toString()));
command.stderr.on("data", (data) => reject(data));
});
};
module.exports = function promptForInstallation(packages, ...args) {
const nameOfPackage = "@webpack-cli/" + packages;
let packageIsInstalled = false;
let pathForCmd;
try {
const path = require("path");
const fs = require("fs");
pathForCmd = path.resolve(process.cwd(), "node_modules", "@webpack-cli", packages);
if (!fs.existsSync(pathForCmd)) {
const globalModules = require("global-modules");
pathForCmd = globalModules + "/@webpack-cli/" + packages;
require.resolve(pathForCmd);
} else {
require.resolve(pathForCmd);
}
packageIsInstalled = true;
} catch (err) {
packageIsInstalled = false;
}
if (!packageIsInstalled) {
const path = require("path");
const fs = require("fs");
const readLine = require("readline");
const isYarn = fs.existsSync(path.resolve(process.cwd(), "yarn.lock"));
const packageManager = isYarn ? "yarn" : "npm";
const options = ["install", "-D", nameOfPackage];
if (isYarn) {
options[0] = "add";
}
if (packages === "init") {
if (isYarn) {
options.splice(1, 1); // remove '-D'
options.splice(0, 0, "global");
} else {
options[1] = "-g";
}
}
const commandToBeRun = `${packageManager} ${options.join(" ")}`;
const question = `Would you like to install ${packages}? (That will run ${commandToBeRun}) (yes/NO) : `;
console.error(`The command moved into a separate package: ${nameOfPackage}`);
const questionInterface = readLine.createInterface({
input: process.stdin,
output: process.stdout
});
questionInterface.question(question, answer => {
questionInterface.close();
switch (answer.toLowerCase()) {
case "y":
case "yes":
case "1": {
runCommand(packageManager, options)
.then(_=> {
if (packages === "init") {
npmGlobalRoot()
.then((root) => {
const pathtoInit = path.resolve(root.trim(), "@webpack-cli", "init");
return pathtoInit;
})
.then((pathForInit) => {
return require(pathForInit).default(...args);
})
.catch((error) => {
console.error(error);
process.exitCode = 1;
});
return;
}
pathForCmd = path.resolve(process.cwd(), "node_modules", "@webpack-cli", packages);
if (packages === "serve") {
return require(pathForCmd).default.serve();
}
return require(pathForCmd).default(...args); //eslint-disable-line
})
.catch(error => {
console.error(error);
process.exitCode = 1;
});
break;
}
default: {
console.error(`${nameOfPackage} needs to be installed in order to run the command.`);
process.exitCode = 1;
break;
}
}
});
} else {
require(pathForCmd).default(...args); // eslint-disable-line
}
};
+20
View File
@@ -0,0 +1,20 @@
{
"anyOf": [
{
"type": "object",
"description": "A webpack configuration object."
},
{
"type": "array",
"description": "An array of webpack configuration objects.",
"items": {
"description": "A webpack configuration object.",
"type": "object"
}
},
{
"instanceof": "Promise",
"description": "A promise that resolves with a configuration object, or an array of configuration objects."
}
]
}
+202
View File
@@ -0,0 +1,202 @@
{
"_from": "webpack-cli@^3.1.2",
"_id": "webpack-cli@3.3.0",
"_inBundle": false,
"_integrity": "sha512-t1M7G4z5FhHKJ92WRKwZ1rtvi7rHc0NZoZRbSkol0YKl4HvcC8+DsmGDmK7MmZxHSAetHagiOsjOB6MmzC2TUw==",
"_location": "/webpack-cli",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "webpack-cli@^3.1.2",
"name": "webpack-cli",
"escapedName": "webpack-cli",
"rawSpec": "^3.1.2",
"saveSpec": null,
"fetchSpec": "^3.1.2"
},
"_requiredBy": [
"/laravel-mix"
],
"_resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.0.tgz",
"_shasum": "55c8a74cae1e88117f9dda3a801c7272e93ca318",
"_spec": "webpack-cli@^3.1.2",
"_where": "D:\\Atom\\Git\\Laravel_CSSd\\node_modules\\laravel-mix",
"bin": {
"webpack-cli": "./bin/cli.js"
},
"bugs": {
"url": "https://github.com/webpack/webpack-cli/issues"
},
"bundleDependencies": false,
"bundlesize": [
{
"path": "./packages/migrate/**.js",
"maxSize": "1 kB"
},
{
"path": "./packages/init/**/**.js",
"maxSize": "1.6 kB"
},
{
"path": "./packages/utils/**.js",
"maxSize": "5.32 kB"
}
],
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-customizable"
},
"cz-customizable": {
"config": "./.cz-config.js"
}
},
"dependencies": {
"chalk": "^2.4.1",
"cross-spawn": "^6.0.5",
"enhanced-resolve": "^4.1.0",
"findup-sync": "^2.0.0",
"global-modules": "^1.0.0",
"import-local": "^2.0.0",
"interpret": "^1.1.0",
"loader-utils": "^1.1.0",
"supports-color": "^5.5.0",
"v8-compile-cache": "^2.0.2",
"yargs": "^12.0.5"
},
"deprecated": false,
"description": "CLI for webpack & friends",
"devDependencies": {
"@babel/preset-env": "^7.3.4",
"@babel/register": "^7.0.0",
"@commitlint/cli": "^7.2.1",
"@commitlint/config-lerna-scopes": "^7.2.1",
"@commitlint/prompt-cli": "^7.5.0",
"@commitlint/travis-cli": "^7.2.1",
"@types/jest": "^23.3.14",
"@types/node": "^10.12.9",
"babel-preset-env": "^1.7.0",
"babel-preset-jest": "^24.3.0",
"bundlesize": "^0.17.0",
"codecov": "^3.1.0",
"commitizen": "^3.0.7",
"commitlint-config-cz": "^0.10.1",
"conventional-changelog-cli": "^2.0.11",
"cz-customizable": "^5.3.0",
"eslint": "^5.9.0",
"eslint-plugin-node": "^8.0.0",
"esm": "^3.2.14",
"execa": "^1.0.0",
"husky": "^1.1.4",
"jest": "^24.3.1",
"jest-cli": "^24.3.1",
"jest-junit": "^6.3.0",
"lerna": "^3.13.1",
"lint-staged": "7.x.x",
"nyc": "^13.3.0",
"prettier-eslint-cli": "^4.7.1",
"readable-stream": "^3.0.6",
"rimraf": "^2.6.2",
"schema-utils": "^1.0.0",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typedoc": "^0.13.0",
"typedoc-plugin-monorepo": "^0.1.0",
"typescript": "^3.3.1",
"webpack": "4.x.x",
"webpack-dev-server": "^3.1.10"
},
"engines": {
"node": ">=6.11.5"
},
"files": [
"bin",
"scripts"
],
"homepage": "https://github.com/webpack/webpack-cli#readme",
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"jest": {
"testPathIgnorePatterns": [
"^.+\\.(ts)?$",
"/node_modules/"
],
"testEnvironment": "node",
"collectCoverage": true,
"coverageReporters": [
"json",
"html",
"cobertura"
],
"moduleNameMapper": {
"^.+\\.(ts)?$": "ts-jest"
}
},
"keywords": [
"webpack",
"cli",
"scaffolding",
"module",
"bundler"
],
"license": "MIT",
"lint-staged": {
"{packages,bin}/**/!(__testfixtures__)/**.js": [
"eslint --fix",
"git add"
],
"{packages,bin}/**/!(__testfixtures__)/**.ts": [
"tslint --fix",
"git add"
]
},
"main": "./bin/cli.js",
"name": "webpack-cli",
"nyc": {
"include": [
"bin/**.js",
"packages/**/*.js"
],
"reporter": [
"lcov"
],
"all": true
},
"peerDependencies": {
"webpack": "4.x.x"
},
"repository": {
"type": "git",
"url": "git+https://github.com/webpack/webpack-cli.git"
},
"scripts": {
"bootstrap": "npm run clean:all && npm install && lerna bootstrap",
"build": "tsc",
"bundlesize": "bundlesize",
"changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile CHANGELOG.md --same-file",
"clean:all": "rimraf node_modules packages/*/{node_modules}",
"commit": "git-cz",
"docs": "typedoc",
"format": "prettier-eslint ./bin/*.js ./test/**/*.js ./packages/**/*.js --write",
"lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"packages/**/!(node_modules)/*.test.js\"",
"lint:codeOnly": "eslint \"{bin}/**/!(__testfixtures__)/*.js\" \"{bin}/**.js\"",
"pretest": "npm run build && npm run lint && npm run tslint",
"reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov",
"test": "nyc jest --maxWorkers=4 --reporters=default --reporters=jest-junit",
"test:ci": "nyc jest --maxWorkers=$(nproc) --reporters=default --reporters=jest-junit",
"travis:integration": "npm run build && npm run test && npm run reportCoverage",
"travis:lint": "npm run build && npm run lint && npm run tslint",
"tslint": "tslint -c tslint.json \"packages/**/*.ts\"",
"watch": "npm run build && tsc -w"
},
"version": "3.3.0"
}