|
3 | 3 | :description_short: Information on bundling plugins |
4 | 4 | :description: Information on bundling TinyMCE plugins using module loading |
5 | 5 |
|
| 6 | +== Overview |
| 7 | + |
| 8 | +{productname} plugins can be bundled using module loaders such as Webpack, Rollup, or Vite. This guide covers how to include both community and premium plugins in your application bundle. |
| 9 | + |
| 10 | +{productname} includes both community and premium plugins: |
| 11 | + |
| 12 | +* **Community plugins**: Available with all {productname} installations |
| 13 | +* **Premium plugins**: Available with paid {productname} subscriptions via the `+tinymce-premium+` package |
| 14 | + |
6 | 15 | :editorcomponent: plugin |
7 | 16 | include::partial$module-loading/bundling-ref-example.adoc[] |
8 | 17 | :!editorcomponent: |
9 | 18 |
|
10 | 19 | include::partial$plugin-files/plugin-file-index.js.adoc[] |
11 | 20 |
|
| 21 | +== Bundling syntax examples |
12 | 22 |
|
13 | | -Example syntax for including the example "<plugincode>" plugin in a bundle using `content.js`for bundling: |
| 23 | +The following examples show the syntax for including plugins in a bundle. The examples use a placeholder `+<plugincode>+` to represent any plugin name: |
14 | 24 |
|
15 | 25 | [cols='1,2,3'] |
16 | 26 | |=== |
@@ -81,27 +91,28 @@ require('<path_to_tinymce_premium_zip>/plugins/<plugincode>'); |
81 | 91 |
|
82 | 92 | After installing the `+tinymce-premium+` package, you need to configure the plugins in your editor. There are two main approaches: |
83 | 93 |
|
84 | | -=== License key manager |
85 | | - |
86 | 94 | [IMPORTANT] |
87 | 95 | ==== |
88 | | -Remember to include the `+licensekeymanager+` plugin when using premium plugins with a commercial license. The editor will not function properly without it. For more information, see: xref:license-key.adoc[License Key]. |
89 | | -==== |
| 96 | +*License Key Manager Requirement:* |
90 | 97 |
|
91 | | -When bundling: |
| 98 | +When using premium plugins with a commercial license, you must include the `+licensekeymanager+` plugin. The editor will not function properly without it. For more information, see: xref:license-key.adoc[License Key]. |
| 99 | +
|
| 100 | +*xref:bundling-plugins.adoc#bundling-recommended[When bundling]:* |
92 | 101 | [source,js] |
93 | 102 | ---- |
94 | 103 | import 'tinymce-premium/plugins/licensekeymanager'; |
95 | 104 | ---- |
96 | 105 |
|
97 | | -When using `+external_plugins+`: |
| 106 | +*xref:bundling-plugins.adoc#using-external-plugins[When using `+external_plugins+`]:* |
98 | 107 | [source,js] |
99 | 108 | ---- |
100 | 109 | external_plugins: { |
101 | 110 | 'licensekeymanager': '<path_to_premium_plugins>/licensekeymanager/plugin.min.js' |
102 | 111 | } |
103 | 112 | ---- |
| 113 | +==== |
104 | 114 |
|
| 115 | +[[bundling-recommended]] |
105 | 116 | === Bundling (Recommended) |
106 | 117 |
|
107 | 118 | For most modern applications, bundling premium plugins is recommended. This includes the plugin code directly in your application bundle. |
@@ -130,6 +141,7 @@ tinymce.init({ |
130 | 141 |
|
131 | 142 | For complete bundling examples, see the <<premium-plugins,Premium plugins>> and <<community-plugins,Community plugins>> sections below. |
132 | 143 |
|
| 144 | +[[using-external-plugins]] |
133 | 145 | === Using external_plugins (Non-bundling) |
134 | 146 |
|
135 | 147 | When bundling is not available or you want to lazy-load plugins, use the `+external_plugins+` option: |
|
0 commit comments