alohaeditor / Aloha-Editor

Aloha Editor is a JavaScript content editing library
http://www.alohaeditor.org
Other
2.46k stars 535 forks source link

Any way to use without require.js? #848

Open obrienmd opened 11 years ago

obrienmd commented 11 years ago

We're having all sort of require.js issues with other scripts we're using (for instance, socket.io) in conjunction with Aloha Editor.

For instance: Uncaught Error: Mismatched anonymous define() module: function () { return io; } http://requirejs.org/docs/errors.html#mismatch require.js:1818

Is there a way to use Aloha without loading require.js?

deliminator commented 11 years ago

Compile Aloha with language files included. To do that, you have to customize the build process (explained in a guide). You only need to set the 'locale' property in the build profile. That will compile a single language into the output file.

If you use plugins that are not included by default, you may also need to add those to the build profile. Almost all plugins are already included by default, so I think you will not have to do this step.

The resulting output file will still need requirejs or almond.js, but you can delete the global variables used by requirejs delete window.require; delete window.requirejs; delete window.define;. Without requirejs's require and define globals, there should not be any problems with other scripts.

obrienmd commented 11 years ago

Thanks! I'll take a look.

deliminator commented 11 years ago

There is also the branch dev-modular, which lets you use aloha without requirejs, but since that isn't merged yet, I recommend the approach in my last comment.

obrienmd commented 11 years ago

Cool - Any idea on an ETA for dev-modular bits being in a release?

deliminator commented 11 years ago

I'm currently working on other things. Can't say more than that it should be done before the 1.0 release.

kamov commented 9 years ago

Does exist a solution for use without requirejs?