Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude storyblok-js-client from @storyblok/js build #514

Closed
1 task done
juusopiikkila opened this issue Jun 7, 2024 · 1 comment
Closed
1 task done

Exclude storyblok-js-client from @storyblok/js build #514

juusopiikkila opened this issue Jun 7, 2024 · 1 comment
Labels
wontfix [Issue] This will not be worked on

Comments

@juusopiikkila
Copy link

juusopiikkila commented Jun 7, 2024

Description

I am looking to modify the Vite configuration for the @storyblok/js package to ensure that the storyblok-js-client library is not bundled within the distribution build. The intention is to treat storyblok-js-client as an external dependency, which should be loaded separately rather than being included in the final build output.

Suggested solution or improvement

I added storyblok-js-client as an external module and defined a global variable for it to ensure it is not bundled with the distribution. The updated configuration is as follows:

// Updated Rollup Options
rollupOptions: {
  output: {
    globals: {
      'storyblok-js-client': 'StoryblokJSClient',
    },
  },
  external: ['storyblok-js-client'],
}

Additional context

With the new configuration, the expectation is that storyblok-js-client will be referenced as an external resource in projects utilizing @storyblok/js, thereby reducing the bundle size and separating concerns.

Validations

@juusopiikkila juusopiikkila added enhancement pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Jun 7, 2024
@alvarosabu alvarosabu added feature [Issue] New feature or request and removed enhancement labels Aug 21, 2024
@alvarosabu alvarosabu removed the feature [Issue] New feature or request label Feb 12, 2025
@alvarosabu
Copy link
Contributor

Hi @juusopiikkila thanks for the suggestion, it's done by design because the Tree-shaking will only include the resources you need. Feel free to re-open if needed.

@alvarosabu alvarosabu added wontfix [Issue] This will not be worked on and removed pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix [Issue] This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants