drunomics / nuxtjs-drupal-ce

A Nuxt module to easily connect Drupal via custom elements.
https://lupus-decoupled.org/
MIT License
22 stars 4 forks source link

Module options should not appear in the client bundle #201

Closed vloss3 closed 1 month ago

vloss3 commented 3 months ago

Motivation / Goals

Module options(incl. defaults set by the module) appear in the Nuxt window object as part of the runtimeConfig, which increases the size of the bundle.

Requirements

Reduce the module options being sent to only what's necessary.

fago commented 3 months ago
    drupalBaseUrl: '',   // -> needed at client
    ceApiEndpoint: '/ce-api',   // -> needed at client
    menuEndpoint: 'api/menu_items/$$$NAME$$$', // -> needed at client
    customErrorPages: false, // -> needed at client
    fetchOptions: {  // -> needed at client
    fetchProxyHeaders: ['cookie'], // -> not needed
    useLocalizedMenuEndpoint: true, // -> needed at client
    addRequestFormat: false, // -> needed at client
    exposeAPIRouteRules: true, // -> not needed
    passThroughHeaders: // -> not needed
fago commented 3 months ago
exposeAPIRouteRules: true, // -> not needed
passThroughHeaders: // -> not needed

seem to be still passed to the client