-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webpack): documentation for configuring webpack
- Loading branch information
Showing
10 changed files
with
167 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
docs/generated/packages/webpack/documents/webpack-config-setup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Configure webpack on your Nx workspace | ||
|
||
You can configure Webpack using a `webpack.config.js` file. If you do so, you can set the path to this file in your `project.json` file, in the `build` target options: | ||
|
||
```json | ||
//... | ||
"my-app": { | ||
"targets": { | ||
//... | ||
"build": { | ||
"executor": "@nrwl/webpack:webpack", | ||
//... | ||
"options": { | ||
//... | ||
"webpackConfig": "apps/my-app/webpack.config.js" | ||
}, | ||
"configurations": { | ||
... | ||
} | ||
}, | ||
} | ||
} | ||
``` | ||
|
||
In that file, you can add the necessary configuration for Webpack. You can read more on how to configure webpack in the [Webpack documentation](https://webpack.js.org/concepts/configuration/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,25 @@ | ||
# Set up your webpack config | ||
# Configure webpack on your Nx workspace | ||
|
||
You can configure Webpack using a `webpack.config.js` file. If you do so, you can set the path to this file in your `project.json` file, in the `build` target options: | ||
|
||
```json | ||
//... | ||
"my-app": { | ||
"targets": { | ||
//... | ||
"build": { | ||
"executor": "@nrwl/webpack:webpack", | ||
//... | ||
"options": { | ||
//... | ||
"webpackConfig": "apps/my-app/webpack.config.js" | ||
}, | ||
"configurations": { | ||
... | ||
} | ||
}, | ||
} | ||
} | ||
``` | ||
|
||
In that file, you can add the necessary configuration for Webpack. You can read more on how to configure webpack in the [Webpack documentation](https://webpack.js.org/concepts/configuration/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
`project.json`: | ||
|
||
```json | ||
//... | ||
"my-app": { | ||
"targets": { | ||
//... | ||
"build": { | ||
"executor": "@nrwl/webpack:webpack", | ||
//... | ||
//... | ||
"options": { | ||
... | ||
}, | ||
//... | ||
} | ||
}, | ||
} | ||
} | ||
``` | ||
|
||
```bash | ||
nx build my-app | ||
``` | ||
|
||
## Examples | ||
|
||
{% tabs %} | ||
{% tab label="Add a path to your webpack.config.js file" %} | ||
|
||
You can configure Webpack using a `webpack.config.js` file. If you do so, you can set the path to this file in your `project.json` file, in the `build` target options: | ||
|
||
```json | ||
//... | ||
"my-app": { | ||
"targets": { | ||
//... | ||
"build": { | ||
"executor": "@nrwl/webpack:webpack", | ||
//... | ||
"options": { | ||
//... | ||
"webpackConfig": "apps/my-app/webpack.config.js" | ||
}, | ||
"configurations": { | ||
... | ||
} | ||
}, | ||
} | ||
} | ||
``` | ||
|
||
Read more on how to configure Webpack in the [Nx Webpack documentation](/packages/webpack/documents/webpack-config-setup). | ||
|
||
{% /tab %} | ||
|
||
{% /tabs %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -394,5 +394,6 @@ | |
} | ||
] | ||
} | ||
} | ||
}, | ||
"examplesFile": "../../../docs/webpack-build-executor-examples.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters