query-engine
query-engine copied to clipboard
Using with Webpack
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.
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.
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.
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.
Will be addressed with https://github.com/bevry/query-engine/issues/43