LDflex / Query-Solid

Simple access to data in Solid pods through LDflex expressions
https://solid.github.io/query-ldflex/
MIT License
66 stars 15 forks source link

how to externalize query-ldflex in shighl webpack.config.js ? #57

Closed scenaristeur closed 4 years ago

scenaristeur commented 4 years ago

Hi @RubenVerborgh ,

I'm working on Shighl a S-olid HIGH L-evel API based on query-ldflex, this is a tool with some high level function to interact with POD session, inbox, longchat and I need to externalize query-ldflex, but I don't know on to configure Webpack for that.

I've tried some

  externals: {
    'solid-auth-cli': 'null',
 '@solid/query-ldflex': 'query-ldflex',
    /*  '@solid/query-ldflex': {
    commonjs: 'query-ldflex',
    commonjs2: 'query-ldflex',
    amd: 'query-ldflex',
    root: 'data'
  },*/

but I got this error " TypeError: _solid_query_ldflexWEBPACK_IMPORTED_MODULE20default.a is undefined"

I can import vendor/solid-query-ldflex.bundle.js on this page https://scenaristeur.github.io/shighl/externalize.html but my lib is always ~10Mo. Do you have an idea ? Thxs

RubenVerborgh commented 4 years ago

Hi @scenaristeur,

Since LDflex for Solid is exposed as window.solid.data, you will want something like:

      '@solid/query-ldflex': {
        root: ['solid', 'data'],
        commonjs: '@solid/query-ldflex', // not used, but needed for config
        commonjs2: '@solid/query-ldflex',  // not used, but needed for config
      },
scenaristeur commented 4 years ago

thxs it's perfect and works like a charm ! https://scenaristeur.github.io/shighl/instances.html