-
-
Notifications
You must be signed in to change notification settings - Fork 201
quilljs with webpack-encore. #58
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
Comments
Hey @bogdaniel! I haven't used quilljs before, but it doesn't look like it needs any special configuration. Their webpack-example (which I think you were working from) includes some configuration for typescript...but I don't think the library even needs that (but I could be wrong). It seems you an use a standard var Quill = require('quill');
// or possibly this
var Quill = require('quill/core/quill');
var container = $('.editor').get(0);
var editor = new Quill(container); Their docs are a bit confusing on how to use quill as a proper js module. |
Yeah i'm trying to follow their webpack config with nothing too fancy used yarn to install the libraries they said they are needed and after that i was stuck with the alias and that entire config.. :D Reverted my webpack config to default from sf documentation and i'm gonna try with it clean :D gonna come back with an answer. :-) |
@bogdaniel Ah, actually it makes more sense now - but it's still a bit of a mess:
So basically, you have 2 possible options:
var Quill = require('quill');
// the rest of the stuff That would actually import the dist file... which isn't ideal, but might be a good workaround. But, it also may not work :).
And that's it :). Once #50 is loaded, all you should need to do is add the 2 Let us know what you find out - including any errors! |
Good Morning @weaverryan. I think i managed doing everything, didn't use that pull request used the function addLoader() ( hope that's the purpose of it, and i got to this point
I think the issue from what i could find on google is because babel runs before typescript or something like that and uglifyjs only supports the es2015. :D i changed in babelConfig to use es2015 and ts es2015 but without any luck =D . |
@bogdaniel Yep, that error I believe us exactly as you said: the current version of uglifyjs doesn't support es2015. Are/were you specifying any custom Babel config? Out-of-the-box, the Encore config should be transpiling your code to pre-es2015 code (so that Uglify doesn't choke on it). But, there could be something special happening related to Typescript. Also, post as much of your code as you can - it'll help debug :) |
Closing this. I don't think there's any action for us to take unless we here a bit more. Thanks @bogdaniel! |
I had the same problem. I compiled TypeScript and got the error:
I found a solution here: babel/babel-preset-env#251 (comment) delete module.exports.module.rules[0].exclude; // remove the exclude from the babel-loader to my |
I got the same problem an find the solution like this : As mentionned by @weaverryan you just need to import Quill like this, for a simple use case : If you want to customize Quill @bogdaniel you should post your webpack config |
I'm trying to figure it out how to setup aliases and everything from this webpack config for loading quilljs editor. maybe you guys have an idea or something.
The text was updated successfully, but these errors were encountered: