query-engine icon indicating copy to clipboard operation
query-engine copied to clipboard

Using with Webpack

Open dschissler opened this issue 10 years ago • 4 comments

Has anyone been able to get this working with Webpack? I tried shimming it but I'm not sure what is going wrong. It was complaining about not being able to find the parent. In fact, none of the require calls were working inside of it.

dschissler avatar Mar 01 '15 23:03 dschissler

I wasn't able to get this working with the npm package. I used the bower package and I'm using the coffeescript source with a change to the require line.

Backbone = @Backbone or window?.Backbone or (try require?('backbone')) or (try require?('exoskeleton')) or null

simply becomes:

Backbone = require 'backbone'

It seems like the conventional way to load alternatives like Exoskeleton and Lodash is to create an alias in the webpack config.

dschissler avatar Mar 02 '15 04:03 dschissler

Also, I've created a new internal package with just the coffeescript file because the 50KB file is pulling in 2.7MB of hard wired dependencies such as Backbone, Underscore, Jquery, etc. I just don't need to be downloading that many extra files and it since I'm traveling I can't always be sure of th quality of my Internet connection and I need to be able to easily do a fresh npm install.

dschissler avatar Mar 02 '15 04:03 dschissler

Has anyone considered removing the shims from query-engine and making the bundler take care of that instead? It seems to me that it is the responsibility of the bundler tool like requirejs, webpack and browserify to wire up a API compatible clone like Exoskeleton.

dschissler avatar Mar 02 '15 04:03 dschissler

Will be addressed with https://github.com/bevry/query-engine/issues/43

balupton avatar Feb 26 '16 08:02 balupton