Closed k00p closed 5 years ago
By the way - this project is a really fun idea. Thank you!
https://observablehq.com/@mbostock/hello-dagre
An example of useful things that can be done when webpacks are included in repos.
In the lodash declaration the minimized JS is pulled from the lodash repo:
lodash = window.lodash = await require("lodash@4/lodash.min.js")
Any chance you would reconsider having the webpack available so that it could be used on "web REPL" apps like Observable or even in GraphiQL?
@k00p You can use jsDeliver CDN: https://cdn.jsdelivr.net/npm/graphql-lodash@1.3.4/lib/graphql-lodash.bundle.js
This PR adds a build:dist script to package.json to include graphql-lodash.bundle.js in npm distribution, which gets copied from
lib/
to a new directorydist/
.Sourcing the pre-built
graphql-lodash.bundle.js
is useful for scenarios where it is not feasible or desirable to build out a complete React application. For example, if you are integratinggraphql-lodash
in anexpress-graphql
session, it is a fairly significant amount of work/code to set up the React stack and build out the GraphiQL interface, and then integrategraphql-lodash
. It is relatively easy to build thegraphql-lodash
bundle, and include that as well as the GraphiQL bundle on a page as in the GraphiQL example.The fetch function becomes:
Using a
dist/
directory is fairly common practice for providing bundles, but another route may be preferred.