-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webpack): add convertConfigToWebpackPlugin
- Loading branch information
1 parent
5d56e21
commit 941d0f2
Showing
16 changed files
with
744 additions
and
2 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
30 changes: 30 additions & 0 deletions
30
docs/generated/packages/webpack/generators/convert-config-to-webpack-plugin.json
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,30 @@ | ||
{ | ||
"name": "convert-config-to-webpack-plugin", | ||
"factory": "./src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin", | ||
"schema": { | ||
"$schema": "https://json-schema.org/schema", | ||
"$id": "NxWebpackConvertConfigToWebpackPlugin", | ||
"description": "Convert existing Webpack project(s) using `@nx/webpack:webpack` executor that uses `withNx` to use `NxAppWebpackPlugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.", | ||
"title": "Convert Webpack project using withNx to NxAppWebpackPlugin", | ||
"type": "object", | ||
"properties": { | ||
"project": { | ||
"type": "string", | ||
"description": "The project to convert from using the `@nx/webpack:webpack` executor and `withNx` plugin to use `NxAppWebpackPlugin`.", | ||
"x-priority": "important" | ||
}, | ||
"skipFormat": { | ||
"type": "boolean", | ||
"description": "Whether to format files at the end of the migration.", | ||
"default": false | ||
} | ||
}, | ||
"presets": [] | ||
}, | ||
"description": "Convert the project to use the `NxAppWebpackPlugin` and `NxReactWebpackPlugin`.", | ||
"implementation": "/packages/webpack/src/generators/convert-config-to-webpack-plugin/convert-config-to-webpack-plugin.ts", | ||
"aliases": [], | ||
"hidden": false, | ||
"path": "/packages/webpack/src/generators/convert-config-to-webpack-plugin/schema.json", | ||
"type": "generator" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Webpack Plugin (legacy) should convert withNx webpack config to a standard config using NxWebpackPlugin 1`] = ` | ||
"const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin'); | ||
const { NxReactWebpackPlugin } = require('@nx/react/webpack-plugin'); | ||
// This file was migrated using @nx/webpack:convert-config-to-webpack-plugin | ||
module.exports = { | ||
plugins: [ | ||
new NxAppWebpackPlugin(), | ||
new NxReactWebpackPlugin({ | ||
// Uncomment this line if you don't want to use SVGR | ||
// See: https://react-svgr.com/ | ||
// svgr: false | ||
}), | ||
, | ||
], | ||
}; | ||
" | ||
`; |
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
Oops, something went wrong.