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

fix(mc-scripts): support prod sourcemaps when using Vite #2924

Merged
merged 3 commits into from
May 8, 2023

Conversation

emmenko
Copy link
Member

@emmenko emmenko commented Dec 23, 2022

Until now Vite (Rollup) had some issues when running production builds with the sourcemaps option activated.

You can read a bit the thread here: vitejs/vite#2433

However, yesterday an attempt to mitigate this issue was released in Rollup: vitejs/vite#2433 (comment)

The fix is opt-in via the cache option of Rollup by turning it off. To quote the outcome:

The memory still scales proportionately to the number of files, but it should consume less memory per file now.

Let's try it out then!

@changeset-bot
Copy link

changeset-bot bot commented Dec 23, 2022

🦋 Changeset detected

Latest commit: efe1bb0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@commercetools-frontend/mc-scripts Patch
@commercetools-applications/merchant-center-template-starter-typescript Patch
@commercetools-applications/merchant-center-template-starter Patch
@commercetools-local/playground Patch
@commercetools-backend/eslint-config-node Patch
@commercetools-backend/express Patch
@commercetools-backend/loggers Patch
@commercetools-frontend/actions-global Patch
@commercetools-frontend/application-components Patch
@commercetools-frontend/application-config Patch
@commercetools-frontend/application-shell-connectors Patch
@commercetools-frontend/application-shell Patch
@commercetools-frontend/assets Patch
@commercetools-frontend/babel-preset-mc-app Patch
@commercetools-frontend/browser-history Patch
@commercetools-frontend/codemod Patch
@commercetools-frontend/constants Patch
@commercetools-frontend/create-mc-app Patch
@commercetools-frontend/cypress Patch
@commercetools-frontend/eslint-config-mc-app Patch
@commercetools-frontend/i18n Patch
@commercetools-frontend/jest-preset-mc-app Patch
@commercetools-frontend/jest-stylelint-runner Patch
@commercetools-frontend/l10n Patch
@commercetools-frontend/mc-dev-authentication Patch
@commercetools-frontend/mc-html-template Patch
@commercetools-frontend/notifications Patch
@commercetools-frontend/permissions Patch
@commercetools-frontend/react-notifications Patch
@commercetools-frontend/sdk Patch
@commercetools-frontend/sentry Patch
@commercetools-frontend/url-utils Patch
@commercetools-local/visual-testing-app Patch
@commercetools-website/custom-applications Patch
@commercetools-website/components-playground Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2022

Deploy preview for merchant-center-application-kit ready!

✅ Preview
https://merchant-center-application-1cnjadmtc-commercetools.vercel.app
https://appkit-sha-3c2a38e512f5675c2ae438bd2939145fd321501f.commercetools.vercel.app
https://appkit-pr-2924.commercetools.vercel.app

Built with commit efe1bb0.
This pull request is being automatically deployed with vercel-action

@@ -251,6 +251,7 @@ jobs:
- name: Building Playground application
run: yarn playground:build
env:
NODE_OPTIONS: '--max-old-space-size=6144'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so it seems to work but we need to bump the memory.

Maybe we make it an opt-in option to generate the sourcemaps.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great idea 👍

@emmenko emmenko marked this pull request as draft December 23, 2022 14:27
Copy link
Contributor

@CarlosCortizasCT CarlosCortizasCT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@emmenko emmenko marked this pull request as ready for review May 8, 2023 08:18
@emmenko emmenko merged commit 21242a2 into main May 8, 2023
@emmenko emmenko deleted the nm-vite-build-sourcemaps branch May 8, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants