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

Reduce reliance on webpack aliases #623

Closed
ericeslinger opened this issue Mar 31, 2016 · 4 comments
Closed

Reduce reliance on webpack aliases #623

ericeslinger opened this issue Mar 31, 2016 · 4 comments

Comments

@ericeslinger
Copy link
Contributor

This isn't a bug per se, but it is something that I'd appreciate (I can do a PR if you'd like me to).

In order to get my hands dirty with Quill, I've just copied the whole source tree into my project (helps debug the lifecycle of the object). I'm using browserify rather than webpack, but it doesn't seem to cause issues.

The only real problem is the aliasing that is in the webpack.config.js, in particular aliasing quill to quill/core.

If I just drop all the quill code into a directory called quill at the base of my resolver paths, references to quill/blots/break work just fine. But I had to do a global find/replace in the code to change stuff like quill/emitter to quill/core/emitter. This doesn't seem to change anything else, it's just the stuff in the import calls at the top of the files. Changing this on my own means I can't just grab the latest git version, though, without reproducing the find-replace stuff.

The only other issue is defining the QUILL_VERSION globally, but I can take care of that on my own outside the quill source.

@jhchen
Copy link
Member

jhchen commented Apr 4, 2016

To be clear, is the problem that aliasing at all is being used or just the quill to quill/core alias?

@ericeslinger
Copy link
Contributor Author

Using aliases for anything below quill/ is the problem. If i take the extant quill source tree and drop it into my own project, it would work, except I have to change all the import Emitter from 'quill/emitter' to import Emitter from 'quill/core/emitter'. It's not the end of the world, of course.

Alternatively (and even better maybe) would be just exposing most of those objects at the top level of Quill. Right now in the top level quill.js file, the export is just a single Quill object. My specific problem is that I want to construct my own quill object and not register a few of the modules (in particular Image), and then register some custom modules (a replacement image module). I'd also like to make subclasses of existing utility classes (parchment stuff). But because that sub-stuff isn't exposed on the module at the top level, I just dropped the source code into my build tree directly. If I were able to import {QuillCore, Emitter, Image ...} from 'quill', that'd be fine too.

@jhchen jhchen closed this as completed in ec79a36 Apr 7, 2016
@jhchen
Copy link
Member

jhchen commented Apr 7, 2016

I changed the import to include core. You can get access to many of Quill's internals through Quill.import as well now.

@ericeslinger
Copy link
Contributor Author

Oh excellent, thanks- Quill.import is precisely what I need.

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

No branches or pull requests

2 participants