Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Webpack and babel for transpiling source code #48

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

amoshydra
Copy link

@amoshydra amoshydra commented Sep 29, 2018

Added webpack build pipeline to

  • transpile source code with babel
  • create a UMD (Universal Module Definition) output

Hope to resolve:

Tested with: https://codesandbox.io/s/vq10k6y42y

Backward compatibility

This PR should be backward compatible with the existing version, developer should not be expected to make any changes when updating to this version. if they are using the module according the to README's instruction.

import {container, ImageExtend, QuillWatch} from 'quill-image-extend-module'

The code below however, will cease to work. I suspect the developers should not import this module using this method anyway.

import container from from 'quill-image-extend-module/container'
import ImageExtend from 'quill-image-extend-module/ImageExtend'
import QuillWatch from 'quill-image-extend-module/QuillWatch'

Note for IE compatibility

Although with this PR. developer will be able to use this module on IE. There is still a bug prevent IE user from uploading image. However, I believe this should be resolved in a separate issue #47

Source files will now be transpiled into es5 compatible code according
to the .babelrc configuration
This files are not used at the moment since all of the codes are already
copied into index.js previously. The code found inside here are not the
most updated version too. Additional mirroring will be required.
All exported class and functions inside index.js are mirrored
into their respective module. These modules are then exported
like they were before.
Also configure webpack to build code into UMD format
@amoshydra
Copy link
Author

中文翻译


添加了webpack构建管道

  • 使用 babel 转换源代码
  • 创建 UMD (Universal Module Definition)

希望解决:#25,#26,,#35,#42
经测试:https://codesandbox.io/s/vq10k6y42y

向后兼容

此PR应与现有版本向后兼容,如果开发者根据 README 的方法使用,在更新此版本时不需进行任何更改。

import {container, ImageExtend, QuillWatch} from 'quill-image-extend-module'

但是,下面的导入方式将会停止运行。我想开发者也不会使用这方法导入。

import container from from 'quill-image-extend-module/container'
import ImageExtend from 'quill-image-extend-module/ImageExtend'
import QuillWatch from 'quill-image-extend-module/QuillWatch'

IE兼容性

虽然有这个 PR 开发人员将能够在 IE 上导入此模块,仍会有一个错误阻止IE用户上传图片。
我认为这应该在另一个 Issue #47 中解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant