返回介绍

TinyMCE plugin Yeoman generator

发布于 2019-05-06 06:49:51 字数 2282 浏览 1328 评论 0 收藏 0

The TinyMCE Plugin Generator is designed to make it quick and easy to get started creating plugins to extend and enhance your rich-text editing experience.

Install the generator

The plugin generator is built with the project scaffolding tool Yeoman. To get started install both yo (the yeoman command) and the generator with the following command:

npm install --global yo generator-tinymce

Wait for the install to finish.

Run the generator

Start the generator with the following command:

yo tinymce

You will then be guided through these questions:

  1. Plugin name?
    The name of the plugin.
  2. How do you want to write your plugin?
    With what technology do you want to write your plugin? ES2015 transpiled with Babel, Typescript or the module system used internally by Tiny called Bolt.
  3. Use yarn instead of npm?
    Use yarn instead of npm for a speedier install.
  4. Skip git repo initialization?
    Here you can skip the creation of a new repository for the plugin.
  5. What’s your name?
    For license.
  6. Your email? (optional)
    For license.
  7. Your website? (optional)
    For license
  8. Which license do you want to use?
    Choose the license for the plugin.

Yeoman installs the needed dependencies, and the project is bootstrapped and ready. cd into the plugin directory and run the following command to start the auto-reloading development server:

npm start

Create distribution ready build

Run the following command as root once you have completed development of the plugin:

npm run build

A dist directory will be created with a directory named the same as your plugin containing three files:

  • plugin.js - unminified plugin bundle
  • plugin.min.js - minified and uglified plugin bundle
  • LICENSE - the text file containing your license

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文