[TIMOB-27857] Webpack: Add support for plugins from NPM
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-08-25T00:35:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.1.0 |
Components | Tooling |
Labels | n/a |
Reporter | Jan Vennemann |
Assignee | Jan Vennemann |
Created | 2020-04-21T16:59:08.000+0000 |
Updated | 2020-08-25T00:35:26.000+0000 |
Description
*Use case*
The plugin api in appcd-plugin-webpack currently only supports local plugins via the
appcdWebpackPlugins
property in package.json
. To easily share plugins installing them via NPM should be supported as well.
*Plugin naming convention*
For plugins to be discoverable they must follow a specific naming convention:
* appcd-webpack-plugin-<name>
* @scope/appcd-webpack-plugin-<name>
Plugins that are maintained by us can make use of the official scopes @appcd
and @titanium-sdk
and drop the leading appcd-
prefix.
* @appcd/webpack-plugin-<name>
* @titanium-sdk/webpack-plugin-<name>
*Plugin API changes*
The [hasPlugin](https://github.com/appcelerator/appcd-plugin-webpack/blob/dab4ffcc36df7491da3ad4337e0b1114938fbc0c/src/plugin-api/plugin-api.js#L93) methods needs to allow for easy matching of plugin names. Instead of requiring the full package name a short hand check should be available as well.
* <name>
to check for appcd-webpack-plugin-<name>
* @scope/<name>
to check for @scope/appcd-webpack-plugin-<name>
PR: https://github.com/appcelerator/appcd-plugin-webpack/pull/10
Closing.