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

Open
1 task done
juusopiikkila opened this issue Jun 7, 2024 · 0 comments
Open
1 task done

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

juusopiikkila opened this issue Jun 7, 2024 · 0 comments
Labels
feature [Issue] New feature or request pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [Issue] New feature or request pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

2 participants