From 8949f828f9dca2b393bf6d0c85bfe1440462bf57 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Tue, 5 Mar 2019 16:07:28 +0100 Subject: [PATCH 01/11] docs(scaffolding): improved structure, formatting, typos --- SCAFFOLDING.md | 126 +++++++++++++++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 45 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index e2ac69782ba..2ec2d22364f 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -2,101 +2,137 @@ Setting up webpack for the first time is hard. Writing advanced configurations to optimize performance is even harder. The `init` feature is designed to support people that want to create their own configuration or initializing other projects people create. -## Writing a good scaffold +## Creating a scaffold -Before writing a `webpack-cli` scaffold, think about what you're trying to achieve. Do you want a "general" scaffold that could be used by any project or type of app? Do you want something very focused - like a scaffold that writes both your `webpack.config.js` and your framework code? It's also useful to think about the user experience for your scaffold. +Before writing a `webpack-cli` scaffold, think about what you're trying to achieve. Do you want a "general" scaffold that could be used by any project or type of app? Do you want something very focused, like a scaffold that writes both your `webpack.config.js` and your framework code? It's also useful to think about the user experience for your scaffold. `webpack-cli` offers an experience that is interactive and you can prompt users for questions (like, "What is your entry point?") to help customize the output accordingly. -## webpack-scaffold +### Writing a scaffold -`webpack-scaffold` is a utility suite for creating scaffolds. It contains functions that could be of use for creating an scaffold yourself. +There are many resources where you can learn how to write a scaffold, you can start from: [How do I compose a +webpack-scaffold?](https://github.com/evenstensberg/webpack-scaffold-demo) -## webpack-scaffold-yourpackage -In order for `webpack-cli` to compile your package, it must be available on npm or on your local filesystem. If you are curious about how you can create your very own `scaffold`, please read [How do I compose a -webpack-scaffold?](https://github.com/evenstensberg/webpack-scaffold-demo). +[`webpack-scaffold`](./packages/webpack-scaffold) is a utility suite for creating scaffolds. It contains functions that could be used to create a scaffold. -If the package is on npm, its name must have a prefix of `webpack-scaffold`. -If the package is on your local filesystem, it can be named whatever you want. Pass the path to the package. +### Running a scaffold + +A scaffold can be executed running: + +```js +webpack-cli init +``` + +#### Running a scaffold locally +When the scaffold package is on you local file system you should pass its path to `init`: + +```js +webpack-cli init path/to/your/scaffold +``` + +#### Running a scaffold from npm + +If the package is on npm, its name must begin with `webpack-scaffold` and can be used running: + +```js +webpack-cli init webpack-scaffold-yourpackage +``` + ## API To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). Its worth noting that we support all the properties of a regular webpack configuration. In order for us to do this, there's a thing you need to remember. -Objects are made using strings, while strings are made using double strings. This means that in order for you to create an string, you have to wrap it inside another string for us to validate it correctly. +Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly. +### Required +- [opts.env.configuration](#`opts.env.configuration`-(required)) +- [opts.env.configuration.myConfig](#`opts.env.configuration.myConfig`-(required)) +- [myConfig.webpackOptions](#`myConfig.webpackOptions`-(required)) +- [writing()](#`writing()`-(required)) + +### Optional +- [myConfig.merge](#`myConfig.merge`-(optional)) +- [myConfig.topScope](#`myConfig.topScope`-(optional)) +- [myObj.configName](#`myObj.configName`-(optional)) -### `opts.env.configuration`(required) +### `opts.env.configuration` (required) -Initialized inside the constructor of your generator in order for the CLI to work. +Is initialized inside the constructor of your generator in order for the CLI to work. ```js constructor(args, opts) { - super(args, opts); - opts.env.configuration = {}; - } + super(args, opts); + opts.env.configuration = {}; +} ``` -### `opts.env.configuration.myObj` (required) -`myObj` is your scaffold. This is where you will add options for the CLI to transform into a configuration. You can name it anything, and you can also add more objects, that could represent a `dev.config` or `prod.config`. +### `opts.env.configuration.myConfig` (required) + +Every `myConfig` will be transformed into a webpack configuration. You can name those keys as you prefer (e.g. `dev`, `prod`): ```js constructor(args, opts) { - super(args, opts); - opts.env.configuration = { - dev: {}, - prod: {} - }; - } + super(args, opts); + opts.env.configuration = { + dev: {}, + prod: {} + }; +} ``` -### `myObj.webpackOptions` (required) +### `myConfig.webpackOptions` (required) -As with a regular webpack configuration, this property behaves the same. Inside `webpackOptions` you can declare the properties you want to scaffold. You can for instance, scaffold `entry`, `output` and `context`. +This object behaves as a regular webpack configuration, you declare here properties you want to scaffold, like `entry`, `output` and `context`: (Inside a yeoman method) + ```js -this.options.env.configuration.dev.webpackOptions = { -entry: '\'app.js\'', -output: {....} +this.options.env.configuration.dev = + webpackOptions: { + entry: '\'app.js\'', + output: {....} + } }; ``` -### `myObj.merge` (optional) +### `writing()` (required) -If you want to use `webpack-merge`, you can supply `merge` with the merge property, and the configuration you want to merge it with. +For the scaffolding instance to run, you need to write your configuration to a `.yo-rc.json` file. This could be done using one of the lifecycles in the yeoman generator, such as the `writing` method: ```js -this.options.env.configuration.dev.merge = 'myConfig'; +writing() { + this.config.set('configuration', myObj) +} ``` -### `myObj.topScope`(optional) +### `myConfig.merge` (optional) -The `topScope` property is a way for the authors to add special behaviours, like functions that could be called inside a configuration, or variable initializations and module imports. +If you want to use `webpack-merge`, you can set the `merge` property with the name of the configuration you want to merge with: ```js -this.options.env.configuration.dev.topScope = [ -'var webpack = require(\'webpack\');' -'var path = require(\'path\');' -]; +this.options.env.configuration.dev = { + merge: 'anotherConfig' +}; ``` -### `myObj.configName`(optional) +### `myConfig.topScope` (optional) -If you want to name your `webpack.config.js` something special, you can do that. +The `topScope` property is a way for the to add special behaviours to your scaffold, like functions that could be called inside a configuration, variable initializations and module imports: ```js -this.options.env.configuration.dev.configName = 'base'; +this.options.env.configuration.dev.topScope = [ + 'var webpack = require(\'webpack\');' + 'var path = require(\'path\');' +]; ``` -### `writing` (required) +### `myObj.configName` (optional) -For the scaffolding instance to run, you need to write your configuration to a `.yo-rc.json` file. This could be done using one of the lifecycles in the yeoman generator, such as the `writing` method. +Used if you want to name your `webpack.config.js` differently: ```js -writing() { - this.config.set('configuration', myObj) -} +this.options.env.configuration.dev.configName = 'base'; ``` From 87ba169525718d7583352f4240d3d40bc9402da2 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Tue, 5 Mar 2019 16:13:13 +0100 Subject: [PATCH 02/11] docs(scaffolding): fix typo --- SCAFFOLDING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 2ec2d22364f..1c1a9b20fde 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -56,7 +56,7 @@ Objects are made using strings, while strings are made using double strings. Thi ### Optional - [myConfig.merge](#`myConfig.merge`-(optional)) - [myConfig.topScope](#`myConfig.topScope`-(optional)) -- [myObj.configName](#`myObj.configName`-(optional)) +- [myConfig.configName](#`myConfig.configName`-(optional)) ### `opts.env.configuration` (required) @@ -104,7 +104,7 @@ For the scaffolding instance to run, you need to write your configuration to a ` ```js writing() { - this.config.set('configuration', myObj) + this.config.set('configuration', myConfig) } ``` @@ -129,7 +129,7 @@ this.options.env.configuration.dev.topScope = [ ]; ``` -### `myObj.configName` (optional) +### `myConfig.configName` (optional) Used if you want to name your `webpack.config.js` differently: From f8424be08e15bfec7738388a7ab863c6094e0477 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Tue, 5 Mar 2019 16:31:40 +0100 Subject: [PATCH 03/11] docs(scaffold): add link option for local --- SCAFFOLDING.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 1c1a9b20fde..80e5b5c79a4 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -28,10 +28,18 @@ webpack-cli init #### Running a scaffold locally When the scaffold package is on you local file system you should pass its path to `init`: -```js +```bash webpack-cli init path/to/your/scaffold ``` +Or you can create a global module and symlink to the local one: + +```bash +cd path/to/my-scaffold +npm link +webpack-cli init my-scaffold +``` + #### Running a scaffold from npm If the package is on npm, its name must begin with `webpack-scaffold` and can be used running: From d47eea0ade6234752fd56ece77db92d43440d092 Mon Sep 17 00:00:00 2001 From: "devid.farinelli@gmail.com" Date: Sat, 9 Mar 2019 17:29:42 +0100 Subject: [PATCH 04/11] docs(scaffolding): add yarn example --- SCAFFOLDING.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 80e5b5c79a4..936a5783749 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -34,11 +34,20 @@ webpack-cli init path/to/your/scaffold Or you can create a global module and symlink to the local one: -```bash -cd path/to/my-scaffold -npm link -webpack-cli init my-scaffold -``` +* Using npm + + ```bash + cd path/to/my-scaffold + npm link + webpack-cli init my-scaffold + ``` + +* Using yarn + + ```bash + cd path/to/my-scaffold + yarn link + webpack-cli init my-scaffold #### Running a scaffold from npm From e11c5244f8bb197d30e9304d4e8bb0b10d8a513b Mon Sep 17 00:00:00 2001 From: "devid.farinelli@gmail.com" Date: Sun, 10 Mar 2019 14:16:15 +0100 Subject: [PATCH 05/11] docs(scaffolding): fix links --- SCAFFOLDING.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 936a5783749..d8454d727c1 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -19,7 +19,7 @@ webpack-scaffold?](https://github.com/evenstensberg/webpack-scaffold-demo) ### Running a scaffold -A scaffold can be executed running: +A scaffold can be executed using [`webpack-cli init`](./INIT.md): ```js webpack-cli init @@ -65,15 +65,15 @@ To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/ Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly. ### Required -- [opts.env.configuration](#`opts.env.configuration`-(required)) -- [opts.env.configuration.myConfig](#`opts.env.configuration.myConfig`-(required)) -- [myConfig.webpackOptions](#`myConfig.webpackOptions`-(required)) -- [writing()](#`writing()`-(required)) +- [opts.env.configuration](#optsenvconfiguration-required) +- [opts.env.configuration.myConfig](#optsenvconfigurationmyConfig-required) +- [myConfig.webpackOptions](#myConfigwebpackOptions-required) +- [writing()](#writing()-required) ### Optional -- [myConfig.merge](#`myConfig.merge`-(optional)) -- [myConfig.topScope](#`myConfig.topScope`-(optional)) -- [myConfig.configName](#`myConfig.configName`-(optional)) +- [myConfig.merge](#myConfigmerge-optional) +- [myConfig.topScope](#myConfigtopScope-optional) +- [myConfig.configName](#myConfigconfigName-optional) ### `opts.env.configuration` (required) From 0f657d0bcf4b68cece4c6c5d628362ea60111173 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Tue, 12 Mar 2019 19:39:27 +0100 Subject: [PATCH 06/11] docs(scaffolding): improve description & formatting --- SCAFFOLDING.md | 73 +++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index d8454d727c1..17a54ce6ef8 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -60,24 +60,24 @@ webpack-cli init webpack-scaffold-yourpackage ## API -To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). Its worth noting that we support all the properties of a regular webpack configuration. In order for us to do this, there's a thing you need to remember. +To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). It's worth noting that we support all the properties of a regular webpack configuration. In order for us to do this, there's a thing you need to remember: -Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly. +> Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly. ### Required - [opts.env.configuration](#optsenvconfiguration-required) -- [opts.env.configuration.myConfig](#optsenvconfigurationmyConfig-required) -- [myConfig.webpackOptions](#myConfigwebpackOptions-required) +- [opts.env.configuration.myObj](#optsenvconfigurationmyObj-required) +- [myObj.webpackOptions](#myObjwebpackOptions-required) - [writing()](#writing()-required) ### Optional -- [myConfig.merge](#myConfigmerge-optional) -- [myConfig.topScope](#myConfigtopScope-optional) -- [myConfig.configName](#myConfigconfigName-optional) +- [myObj.merge](#myObjmerge-optional) +- [myObj.topScope](#myObjtopScope-optional) +- [myObj.configName](#myObjconfigName-optional) -### `opts.env.configuration` (required) +### `opts.env.configuration`(required) -Is initialized inside the constructor of your generator in order for the CLI to work. +This is the entry point your configuration, initialize it inside the constructor of your generator in order for the CLI to work: ```js constructor(args, opts) { @@ -85,10 +85,9 @@ constructor(args, opts) { opts.env.configuration = {}; } ``` +### `opts.env.configuration.myObj` (required) -### `opts.env.configuration.myConfig` (required) - -Every `myConfig` will be transformed into a webpack configuration. You can name those keys as you prefer (e.g. `dev`, `prod`): +This is your scaffold, you add here the options that the CLI will transform into a Webpack configuration. You can have many different scaffolds named as you prefer, representing different configurations like `dev.config` or `prod.config`: ```js constructor(args, opts) { @@ -100,56 +99,50 @@ constructor(args, opts) { } ``` -### `myConfig.webpackOptions` (required) - -This object behaves as a regular webpack configuration, you declare here properties you want to scaffold, like `entry`, `output` and `context`: +### `myObj.webpackOptions` (required) -(Inside a yeoman method) +This object has the same format as a regular Webpack configuration, so you declare here the properties that you want to scaffold, like `entry`, `output` and `context`. You can intialize this inside a yeoman method: ```js -this.options.env.configuration.dev = - webpackOptions: { - entry: '\'app.js\'', - output: {....} - } +this.options.env.configuration.dev.webpackOptions = { + entry: '\'app.js\'', + output: {...} }; ``` -### `writing()` (required) +### `myObj.merge` (optional) -For the scaffolding instance to run, you need to write your configuration to a `.yo-rc.json` file. This could be done using one of the lifecycles in the yeoman generator, such as the `writing` method: +If you want to use [`webpack-merge`](https://github.com/survivejs/webpack-merge), you can set the `merge` property of `myObj` to the name of the configuration you want to merge it with: ```js -writing() { - this.config.set('configuration', myConfig) -} +this.options.env.configuration.dev.merge = 'myConfig'; ``` -### `myConfig.merge` (optional) +### `myObj.topScope`(optional) -If you want to use `webpack-merge`, you can set the `merge` property with the name of the configuration you want to merge with: +The `topScope` property is where you write all the special code needed by your configuration, like module imports and function/variables definitions: ```js -this.options.env.configuration.dev = { - merge: 'anotherConfig' -}; +this.options.env.configuration.dev.topScope = [ + 'const webpack = require(\'webpack\');', + 'const path = require(\'path\');' +]; ``` -### `myConfig.topScope` (optional) +### `myObj.configName`(optional) -The `topScope` property is a way for the to add special behaviours to your scaffold, like functions that could be called inside a configuration, variable initializations and module imports: +`configName` allows you to customize the name of your configuration file. For example you can name it `webpack.base.js` instead of the default `webpack.config.js`: ```js -this.options.env.configuration.dev.topScope = [ - 'var webpack = require(\'webpack\');' - 'var path = require(\'path\');' -]; +this.options.env.configuration.dev.configName = 'base'; ``` -### `myConfig.configName` (optional) +### `writing` (required) -Used if you want to name your `webpack.config.js` differently: +For the scaffolding instance to run, you need to write your configuration to a `.yo-rc.json` file. This could be done using one of the lifecycles in the yeoman generator, such as the `writing` method: ```js -this.options.env.configuration.dev.configName = 'base'; +writing() { + this.config.set('configuration', myObj) +} ``` From 98818a1970ea1d3bd4a2c4476b577d71674e1b1f Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Tue, 12 Mar 2019 19:42:43 +0100 Subject: [PATCH 07/11] docs(scaffolding): fix typo --- SCAFFOLDING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 17a54ce6ef8..8593a6410d5 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -26,7 +26,7 @@ webpack-cli init ``` #### Running a scaffold locally -When the scaffold package is on you local file system you should pass its path to `init`: +When the scaffold package is in you local file system you should pass its path to `init`: ```bash webpack-cli init path/to/your/scaffold @@ -120,7 +120,7 @@ this.options.env.configuration.dev.merge = 'myConfig'; ### `myObj.topScope`(optional) -The `topScope` property is where you write all the special code needed by your configuration, like module imports and function/variables definitions: +The `topScope` property is where you write all the code needed by your configuration, like module imports and functions/variables definitions: ```js this.options.env.configuration.dev.topScope = [ From 6b7907243d2bbaaf559d6aefc6082884fd354c82 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Fri, 15 Mar 2019 10:54:09 +0100 Subject: [PATCH 08/11] docs(scaffolding): improve grammar --- SCAFFOLDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 8593a6410d5..9db309034a9 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -51,7 +51,7 @@ Or you can create a global module and symlink to the local one: #### Running a scaffold from npm -If the package is on npm, its name must begin with `webpack-scaffold` and can be used running: +If the package is in npm, its name must begin with `webpack-scaffold` and can be used running: ```js webpack-cli init webpack-scaffold-yourpackage From b94b0de112b9d68a3227027d9a09a943cdd99b84 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Fri, 15 Mar 2019 15:04:10 +0100 Subject: [PATCH 09/11] docs(scaffolding): fix typos --- SCAFFOLDING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 9db309034a9..7897d4d4f19 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -1,6 +1,6 @@ # Introduction -Setting up webpack for the first time is hard. Writing advanced configurations to optimize performance is even harder. The `init` feature is designed to support people that want to create their own configuration or initializing other projects people create. +Setting up Webpack for the first time is hard. Writing advanced configurations to optimize performance is even harder. The `init` feature is designed to support people that want to create their own configuration or initializing other projects people create. ## Creating a scaffold @@ -60,7 +60,7 @@ webpack-cli init webpack-scaffold-yourpackage ## API -To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). It's worth noting that we support all the properties of a regular webpack configuration. In order for us to do this, there's a thing you need to remember: +To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). It's worth noting that we support all the properties of a regular Webpack configuration. In order for us to do this, there's a thing you need to remember: > Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly. @@ -101,7 +101,7 @@ constructor(args, opts) { ### `myObj.webpackOptions` (required) -This object has the same format as a regular Webpack configuration, so you declare here the properties that you want to scaffold, like `entry`, `output` and `context`. You can intialize this inside a yeoman method: +This object has the same format as a regular Webpack configuration, so you declare here the properties that you want to scaffold, like `entry`, `output` and `context`. You can initialize this inside a yeoman method: ```js this.options.env.configuration.dev.webpackOptions = { From d19c1f72e496d773d751255243e7162f78aec977 Mon Sep 17 00:00:00 2001 From: Devid Farinelli Date: Fri, 15 Mar 2019 15:27:36 +0100 Subject: [PATCH 10/11] docs(scaffolding): lowercase Webpack --- SCAFFOLDING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 7897d4d4f19..1c48a41702f 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -1,6 +1,6 @@ # Introduction -Setting up Webpack for the first time is hard. Writing advanced configurations to optimize performance is even harder. The `init` feature is designed to support people that want to create their own configuration or initializing other projects people create. +Setting up webpack for the first time is hard. Writing advanced configurations to optimize performance is even harder. The `init` feature is designed to support people that want to create their own configuration or initializing other projects people create. ## Creating a scaffold @@ -60,7 +60,7 @@ webpack-cli init webpack-scaffold-yourpackage ## API -To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). It's worth noting that we support all the properties of a regular Webpack configuration. In order for us to do this, there's a thing you need to remember: +To create a `scaffold`, you must create a [`yeoman-generator`](http://yeoman.io/authoring/). Because of that, you can optionally extend your generator to include methods from the [Yeoman API](http://yeoman.io/learning/). It's worth noting that we support all the properties of a regular webpack configuration. In order for us to do this, there's a thing you need to remember: > Objects are made using strings, while strings are made using double strings. This means that in order for you to create a string, you have to wrap it inside another string for us to validate it correctly. @@ -87,7 +87,7 @@ constructor(args, opts) { ``` ### `opts.env.configuration.myObj` (required) -This is your scaffold, you add here the options that the CLI will transform into a Webpack configuration. You can have many different scaffolds named as you prefer, representing different configurations like `dev.config` or `prod.config`: +This is your scaffold, you add here the options that the CLI will transform into a webpack configuration. You can have many different scaffolds named as you prefer, representing different configurations like `dev.config` or `prod.config`: ```js constructor(args, opts) { @@ -101,7 +101,7 @@ constructor(args, opts) { ### `myObj.webpackOptions` (required) -This object has the same format as a regular Webpack configuration, so you declare here the properties that you want to scaffold, like `entry`, `output` and `context`. You can initialize this inside a yeoman method: +This object has the same format as a regular webpack configuration, so you declare here the properties that you want to scaffold, like `entry`, `output` and `context`. You can initialize this inside a yeoman method: ```js this.options.env.configuration.dev.webpackOptions = { From a14908e258e79b2438568c8308b66a29fe3fb202 Mon Sep 17 00:00:00 2001 From: ev1stensberg Date: Fri, 15 Mar 2019 19:33:38 +0100 Subject: [PATCH 11/11] chore: revise typo --- SCAFFOLDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCAFFOLDING.md b/SCAFFOLDING.md index 1c48a41702f..855c5fb3442 100644 --- a/SCAFFOLDING.md +++ b/SCAFFOLDING.md @@ -26,7 +26,7 @@ webpack-cli init ``` #### Running a scaffold locally -When the scaffold package is in you local file system you should pass its path to `init`: +When the scaffold package is in your local file system you should pass its path to `init`: ```bash webpack-cli init path/to/your/scaffold