powmedia / backbone-forms

Form framework for BackboneJS with nested forms, editable lists and validation
MIT License
2.17k stars 415 forks source link

How do I load List editor with webpack/browerify? #543

Open peter4k opened 7 years ago

peter4k commented 7 years ago

I tried to load the editor using // import List from 'backbone-forms/distribution.amd/editors/list.js';, but I got error "Cannot read property 'editors' of undefined".

Can someone please help me with a proper way to load the list editor?

Thanks.

glenpike commented 7 years ago

I don't think the List editor is exposed as a CommonJS module, so I expect this might be problematic.

If you can figure out a way of adding this to the build, that might be a way forward.

Currently https://github.com/powmedia/backbone-forms/blob/master/scripts/build#L43 uses the templates to create distribution/backbone-forms*, but this doesn't happen with the editors: https://github.com/powmedia/backbone-forms/blob/master/scripts/build#L62