Each version of Quill is built and ready to use from a variety of sources,
including [NPM](https://www.npmjs.com/package/quill) or its [CDN](../下載download.md).
However there may be use cases where you would like to build Quill from source, as part of your application's build pipeline. If this desire has not occurred to you,
don't sweat it! Using pre-built versions is the easiest way to use Quill.
Quill is built using [Webpack](https://webpack.js.org/concepts/) and this guide is mostly targeted towards Webpack users. However some principles may translate to
other build environments.
A minimal working example of everything covered in this guide can be found at [quill-webpack-example](https://github.com/quilljs/webpack-example/).
### Webpack
You will need to add Webpack and appropriate loaders as development dependencies to your app. The Typescript compiler is necessary
if you want to build Parchment from source as well.
- Quill source code - [`babel-core`](https://www.npmjs.com/package/babel-core), [`babel-loader`](https://www.npmjs.com/package/babel-loader), [`babel-preset-es2015`](https://www.npmjs.com/package/babel-preset-es2015)
- Parchment source code - [`ts-loader`](https://www.npmjs.com/package/ts-loader), [`typescript`](https://www.npmjs.com/package/typescript)
- SVG icons - [`html-loader`](https://www.npmjs.com/package/html-loader)
You Webpack configuration file will also need to alias Quill and Parchment to point to their respective entry source files.
Without this, Webpack will use the pre-built files included in NPM, instead of building from source.
### Entry
Quill is distributed with builds `quill.js` and `quill.core.js`. The purpose of the entry files for both builds,
[quill.js](https://github.com/quilljs/quill/blob/master/quill.js) and [core.js](https://github.com/quilljs/quill/blob/master/core.js),
is to import and register necessary dependencies. You will likely want a similar entry point in your application that includes only the formats,
modules, or themes that you use.
```js
import Quill from 'quill/core';
import Toolbar from 'quill/modules/toolbar';
import Snow from 'quill/themes/snow';
import Bold from 'quill/formats/bold';
import Italic from 'quill/formats/italic';
import Header from 'quill/formats/header';
Quill.register({
'modules/toolbar': Toolbar,
'themes/snow': Snow,
'formats/bold': Bold,
'formats/italic': Italic,
'formats/header': Header
});
export default Quill;
```
### Stylesheets
There is not as much to benefit from building from source in the realm of stylesheets, since rules can be so easily overwritten.
However, [`css-loader`](https://www.npmjs.com/package/css-loader)'s tilde prefix may be useful to include Quill styles in a your application css file.
```css
@import "~quill/dist/quill.core.css"
// Rest of your application CSS
```
### Example
Take a look at [quill-webpack-example](https://github.com/quilljs/webpack-example/) for a minimal working example.
- 前言
- 快速開始(quick_start)
- 下載(download)
- 配置(configuration)
- 格式(formats)
- API
- 內容(contents)
- 格式化(formatting)
- 選區(selection)
- 編輯器(editor)
- 事件(events)
- 模型(model)
- 擴展(extension)
- 增量(Delta)
- 模塊(modules)
- 工具欄(toolbar)
- 鍵盤(keyboard)
- 歷史記錄(history)
- 粘貼板(clipboard)
- 語法高亮(syntax)
- 主題(themes)
- 更多教程
- 為什么選擇Quill?
- 如何定制Quill?
- 設計Delta格式(未翻譯)
- 構建一個自定義模塊
- 將Quill加入你的編譯管線(未翻譯)
- Cloning Medium with Parchment
- 和其它富文本編輯器的對比(未翻譯)
- Designing the Delta Format
- 擴展模塊
- vue-quill-editor
- quill-image-extend-module
- quill-image-resize-module
- quill-image-drop-module
- quill-better-table
- quilljs-table
- 更多模塊